//********Send mail
function sendmail(){
mail("to:******","****title***","$messages","From:[email protected]\nReply-To:[email protected]\nX-Mailer: php\nErrors-To:$from_email_address");
}其中$messages为你为表单内容制作的版面
function sendmail(){
mail("to:******","****title***","$messages","From:[email protected]\nReply-To:[email protected]\nX-Mailer: php\nErrors-To:$from_email_address");
}其中$messages为你为表单内容制作的版面
Warning: mail(): Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set()...
<?
function mymail($mto,$mcc,$msubject,$mbody)
{
$from = "[email protected]";
$sign = "\n";//随你便写些什么
$sendmailpath = "/usr/lib/sendmail";//Semdmail路径
$bound = "========_".uniqid("BCFMail")."==_";//分界符
$headers = "MIME-Version: 1.0\n".
"Content-Type: multipart/mixed; boundary=\"$bound\"\n".
"Date: ".date("D, d M H:i:s Y ")."\n".
"From: $from\n".
"To: $mto\n".
"Cc: $mcc\n".
"Subject: $msubject\n".
"Status: \n".
"X-Status:\n".
"X-Mailer: MY Email Interface\n".
"X-Keywords:\n\n";
$content="--".$bound."\n"."Content-Type:text/plain;charset=\"GB2312\"\n\n".$mbody.$sign."\n";
$end = "\n"."--".$bound."--\n";
$sock = popen("$sendmailpath -t -f '[email protected]'",'w');
fputs($sock, $headers);
fputs($sock, $content);
fputs($sock, $end);
fputs($sock, ".\n");
fputs($sock, "QUIT\n");
pclose($sock);
} mymail("[email protected]", "[email protected]", "test", "test");//backhome.com.cn
?>