PHP下MAIL的另一解决方案
PHP下MAIL的另一解决方案,PHP下MAIL的另一解决方案
function mymail($mto,$mcc,$msubject,$mbody)
{
$from="webmaster@backhome.com.cn";
$sign = "n";//随你便写些什么
$sendmailpath="/usr/lib/sendmail";//Semdmail路径
$bound = "========_".uniqid("BCFMail")."==_";//分界符
$headers = "MIME-Version: 1.0n".
"Content-Type: multipart/mixed; boundary="$bound"n".
"Date: ".date("D, d M H:i:s Y ")."n".
"From: $fromn".
"To: $mton".
"Cc: $mccn".
"Subject: $msubjectn".
"Status: n".
"X-Status:n".
"X-Mailer: MY Email Interfacen".
"X-Keywords:nn";
$content="--".$bound."n"."Content-Type:text/plain;charset="GB2312"nn".$mbody.$sign."n";
$end = "n"."--".$bound."--n";
$sock = popen("$sendmailpath -t -f 'webmaster@backhome.com.cn'",'w');
fputs($sock, $headers);
fputs($sock, $content);
fputs($sock, $end);
fputs($sock, ".n");
fputs($sock, "QUITn");
pclose($sock);
}