原帖由 dolphin_ice 於 1/5/2008 02:02 發表
請問html可唔可以整到hide E-mail但係又可以透過填form來send E-mail 比我?
e.g. http://edition.cnn.com/feedback/forms/form3.html?1
(最好有埋果d咩咩"廣東話按一字" "English press 2"....select category"反捕 ...
原帖由 火雞一隻 於 1/5/2008 03:01 PM 發表
單是HTML的話不可以直接send出, 一定要經過第三方軟件(OE等)中已設定的SMTP Server 送出..
但很多人只用Web mail, 所以沒有在客戶端設好Setting..
所以建議可以用PHP送出郵件, 使Mail不用經過客戶端送出..
...
<?
if (isset($_POST['post']) && $_POST['title'] && $_POST['massage']){
$to = 'admin@lugia.org';
$message = '
<html>
<head>
<title>'.htmlspecialchars($_POST['title']).'</title>
</head>
<body>
'.nl2br(htmlspecialchars($_POST['massage'])).'
</body>
</html>
';
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=utf-8' . "\r\n";
mail($to, $_POST['title'], $message, $headers);
exit('Finish');
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Testing</title>
</head>
<body>
<form id="form1" method="post" action="">
<p>Title:<br />
<label>
<input name="title" type="text" id="title" maxlength="50" />
</label>
</p>
<p>Massage:<br />
<label>
<textarea name="massage" id="massage" cols="45" rows="5"></textarea>
</label>
</p>
<p>
<label>
<input type="submit" name="send" id="send" value="Send" />
</label>
<label>
<input type="reset" name="reset" id="reset" value="Reset" />
</label>
<input name="post" type="hidden" id="post" value="1" />
</p>
</form>
</body>
</html>
<?
if (isset($_POST['post']) && $_POST['name']){
$to = 'admin@lugia.org';
// message
$message = '
<div id="open-letter">
<p> Dear Group CEO Patrick Cescau, </p>
<p> The palm oil Unilever buys to make Dove soap is destroying forests and speeding up climate change. Your palm oil suppliers continue to destroy Indonesia\'s precious rainforests for palm plantations, even though they have promised to change. They haven\'t changed, but Unilever still buys from them, with no consideration for the endangered animals and people who depend on these forests. </p>
<p> Unilever is one of the biggest global consumer goods companies and buys around 1.3 million tonnes of palm oil every year. A truly responsible company would not buy from suppliers who trash forests. Unilever should call for an immediate halt to the destruction of Indonesia\'s forests for palm oil. </p>
<p> Wrecking rainforests for soap and other products is wrong. Will you help save the forests now, or continue destroying them? </p>
<p> Sincerely, </p>
<p> <em>'.htmlspecialchars($_POST['name']).'</em> </p>
</div>
';
// To send HTML mail, the Content-type header must be set
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=utf-8' . "\r\n";
// Mail it
mail($to, 'AN OPEN LETTER TO UNILEVER', $message, $headers);
exit('Finish');
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Testing</title>
</head>
<body>
<form id="form1" method="post" action="">
<p>Name:<br />
<label>
<input name="name" type="text" id="name" maxlength="50" />
</label>
</p>
<p>
<label>
<input type="submit" name="send" id="send" value="Send" />
</label>
<label>
<input type="reset" name="reset" id="reset" value="Reset" />
</label>
<input name="post" type="hidden" id="post" value="1" />
</p>
</form>
</body>
</html>
原帖由 dolphin_ice 於 6/5/2008 16:02 發表
哇! 多謝晒!!
點解2個paste落html都係得一堆code? 唔見有表 oO|||
我係電腦白痴一個, sorry ^^
PS: 轉PHP檔個中文係咩?原來我個frontpage 得中文 orz
原帖由 dolphin_ice 於 6/5/2008 16:02 發表
哇! 多謝晒!!
點解2個paste落html都係得一堆code? 唔見有表 oO|||
我係電腦白痴一個, sorry ^^
PS: 轉PHP檔個中文係咩?原來我個frontpage 得中文 orz
歡迎光臨 香港寵物小精靈村落 論壇 (https://proxy.archiver.hkpnve.pokebeacon.com/) | Powered by Discuz! X3.2 |