Phpmailer is an excellent php email sending plug-in. it can be used to send messages in almost any email address. next I will introduce the sending method of 163 mailbox 126 mailbox yahoo mailbox. preparation: we must register an email (163 Email 1... phpmailer is an excellent php email sending plug-in. it can be used to send messages in almost any email address. next I will introduce the sending method of 163 mailbox 126 mailbox yahoo mailbox.
Preparations:You must register an email address (163 mailbox, 126 mailbox, yahoo mailbox ).
Note:These mailboxes must support login and sending. We do not configure these mailboxes.
163 email $ mail-> Host = "smtp.163.com ";
126 email $ mail-> Host = "smtp.126.com ";
Yahoo mail $ mail-> Host = "smtp.mail.yahoo.com.cn ";
You must write your own username and password in the same way in other places. I use 163 email as an example and the code is as follows:
"; // Use SMTP to send emails $ mail-> IsSMTP (); // the email server $ mail-> Host =" smtp.163.com "; $ mail-> SMTPDebug = 0; // use SMPT to verify $ mail-> SMTPAuth = true; // SMTP-verified user name $ mail-> Username = "******** @ 163.com "; // SMTP authentication secrets $ mail-> Password = "***"; // sets the encoding format $ mail-> CharSet = "UTF-8 "; // set the topic $ mail-> Subject = "test"; // $ mail-> AltBody = "To view the message, please use an HTML compatible email viewer! "; // Set the sender $ mail-> SetFrom ('***** @ 163.com', 'test '); // send an email in html format $ mail-> MsgHTML ($ body); // recipient's email name $ mail-> AddAddress ("*** @ 163.com"," test "); // send the email if (! $ Mail-> Send () {echo "Mailer Error:". $ mail-> ErrorInfo;} else {echo "Message sent! ";}?>
Note that the red part is modified according to your own needs.
Address:
Reprinted at will, but please attach the article address :-)