Phpmailer is a very useful class to send mail in PHP, it encapsulates a lot of important functions and functions, let us send mail, and adjust the contents of the message becomes very easy, the following gives a Phpmailer test case, easy to use later query.
First, you need to download the Phpmailer class library, which can now be extracted from GitHub.
Download Address: Https://github.com/PHPMailer/PHPMailer
The following program: The use of QQ mailbox to test, need to go to the mailbox inside
Set = "account ="Pop3/imap/smtp/exchange/carddav/caldav service
Tick the POP3/SMTP service.
ISSMTP (); $mail->smtpdebug = 2; $mail->host = "smtp.qq.com"; $mail->port = "465"; $mail->smtpsecure = "SSL"; $mail->smtpauth = true; $mail->username = "470356072";//username $mail->password = "******";//repalce your Password $mail Addreplyto ("470356072@qq.com", "Network"); $mail->addaddress ('470356072@qq. com '); $mail->setfrom ("470356072@qq.com", "Network"); $mail->ishtml (false); $mail->subject = "Test mail"; $mail->msghtml ("This is a test mail! "); $mail->send (); if ($mail->send ()) { echo "success"; } else { echo "false"; }? >