php 線上寄信模組

這個模組已經測試成功可以包含html語法
比較需要注意的是語系不可以改成utf-8
寄出去的中文會變亂碼
智邦的伺服器可用!!

寄出的程式


$mailtype='Content-Type:text/html;charset=big5';
$mailFrom=$_POST['mailFrom'];
$mailTo=$_POST['mailTo'];
$mailCC=$_POST['mailCC'];
$mailBCC=$_POST['mailBCC'];
$mailSubject=$_POST['mailSubject'];
$mailContent = nl2br($_POST['mailContent']);
$maildata = "From:$mailFrom\r\n";
if ($mailCC != '') {
$maildata .= "CC:$mailCC\r\n";
}
if ($mailBCC != '') {
$maildata .= "BCC:$mailBCC\r\n";
}
$maildata .= "$mailtype";
mail($mailTo,$mailSubject,$mailContent,$maildata);
?>


從表單頁面接收傳送的變數


寄件者信箱:
$_POST['mailFrom']

收件人信箱:
$_POST['mailTo']

副 本:
$_POST['mailCC']

密件副本:
$_POST['mailBCC']

郵件標題:
$_POST['mailSubject']

郵件內容:
$_POST['mailContent']

留言