Resolved a period of time before I contacted Dec Tru64 Unix i installed the Php+apache, you can use the mail function provided is always unable to send a letter, and then a function, it uses the pipeline under the Unix and PHP sock function to send letters, after the experiment is very successful in the The following is the original code for this function.
function MyMail ($mto, $MCC, $msubject, $mbody)
{
$from = "webmaster@backhome.com.cn";
$sign = "";/whatever you write.
$sendmailpath = "/usr/lib/sendmail";//semdmail path
$bound = "========_". Uniqid ("Bcfmail"). " ==_ ";//delimiters
$headers = "mime-version:1.0".
"Content-type:multipart/mixed; boundary= "$bound" ".
"Date:". Date ("D, D M h:i:s Y"). " ".
"From: $from".
"To: $mto".
"Cc: $MCC".
"Subject: $msubject".
"Status:".
"X-status:".
"X-mailer:my Email Interface".
"X-keywords:";
$content = "-$bound." "." content-type:text/plain;charset= "GB2312" ". $mbody. $sign." ";
$end = "". " --". $bound." -- ";
$sock = Popen ("$sendmailpath-t-F ' webmaster@backhome.com.cn '", ' w ');
Fputs ($sock, $headers);
Fputs ($sock, $content);
Fputs ($sock, $end);
Fputs ($sock, ".");
Fputs ($sock, "QUIT");
Pclose ($sock);
}
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.