Php method 2 (SMTP transfer SMTP Class Call) & lt ;? Phprequire_once (& quot; email2.php & quot;); Method 2 for sending an email to php. (SMTP transmission class) *** server information ** $ MailServersmtp.163.com; SMTP server $ MailPort25; php method 2 for sending mail. (SMTP transfer SMTP Class Call sending)
<? Phprequire_once ("email2.php"); // method 2. (SMTP transmission SMTP class)/*** server information */$ MailServer = 'smtp .163.com '; // smtp server $ MailPort = '25 '; // SMTP server port 25 $ MailId = 'anheng123 @ 163.com 'by default; // server email account $ MailPw = 'xxxxxxxxxxxxxx '; // server email password/*** client information */$ Title = 'system developers report error information'; // mail Title $ bt = "sadfsadf "; $ _ POST ['URL'] = "afasdfasfasfsaf"; $ _ POST ['liance'] = "12312412 "; $ _ POST ['xiangsi'] = "isa in the header of the statement, and I feel like this"; $ td = $ subject. '<br> '. 'Title :'. $ bt.' <Br> '. 'URL :'. $ _ POST ['URL']. '<br> '. 'contact number :'. $ _ POST ['liance']. '<br> '. 'details :'. $ _ POST ['xiangsi']; $ Content = $ td; // email Content $ email = 'chenlong @ anheng.com.cn '; // target receiver email $ smtp = new smtp ($ MailServer, $ MailPort, true, $ MailId, $ MailPw); $ smtp-> debug = false; if ($ smtp-> sendmail ($ email, $ MailId, $ Title, $ Content, "HTML") {echo 'mail sent successfully '; // return result} else {echo 'email sending failed'; // $ succeed = 0 ;}?>