|
//mail.php
//讀信內容
$filename = "wellcom.txt";
$fd = fopen( $filename, "r" );
$contents = fread($fd, filesize($filename));
fclose( $fd );
//替換其中相應內容
$contents=eregi_replace("<username>",$UserName,$contents);
$contents=eregi_replace("<password>",$Password,$contents);
$contents=eregi_replace("<url>",$Url,$contents);
//發信
$to_email=$email;
$from_email="php-Java@21cn.com";
$subject="Wellcom!";
$header_info="From:$from_email/nReply-To:$from_email";
$result=@mail($to_email,$subject,$contents,$header_info);
if($result) {
echo "發信成功!";
} else {
echo "發信失敗!";
}
?>
//wellcom.txt內容;
您的注冊資料為:
用戶名:<username>
密碼:<password>
歡迎您的到來!
歡迎訪問:<url>
php技術:資料注冊后發信小技巧,轉載需保留來源!
鄭重聲明:本文版權歸原作者所有,轉載文章僅為傳播更多信息之目的,如作者信息標記有誤,請第一時間聯系我們修改或刪除,多謝。