Another solution for MAIL in PHP. Some time ago, I came into contact with DECTru64Unix. I installed PHP + APACHE on it. I can use the provided mail function to send emails normally, so I compiled a function, it uses the UNIX pipeline and some time ago I came into contact with DEC Tru64 Unix. I installed PHP + APACHE on it, and the mail function provided can never send emails normally, therefore, a self-developed function that uses a UNIX pipeline and php sock function to send emails. the experiment was very successful. below is the original code of this function.
Function mymail ($ mto, $ mcc, $ msubject, $ mbody)
{
$ From = "webmaster@backhome.com.cn ";
$ Sign = "\ n"; // whatever you want
$ Sendmailpath = "/usr/lib/sendmail"; // Semdmail path
$ Bound = "=======_". uniqid ("BCFMail"). "==_"; // delimiter
$ 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 ";
$ Content = "--". $ bound. "\ n ". "Content-Type: text/plain; charset = \" GB2312 \ "\ n ". $ 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, "QUIT \ n ");
Pclose ($ sock );
}
Unzip Tru64 Unix I installed PHP + APACHE on it. I can use the provided mail function to never send emails normally. so I compiled a function that uses UNIX pipelines and...