Php application PHPMailer is a very useful class for sending emails in php. it encapsulates many important functions and functions, making it easy for us to send emails and adjust the content of emails, the following is a PHPMailer test case for future query.
First, you need to download the PHPMailer class library, which can be decompressed from github.
: Https://github.com/PHPMailer/PHPMailer
The following program is provided: QQ Mail is used for testing, and you need to go to the mailbox
SET = "account ="POP3/IMAP/SMTP/Exchange/CardDAV/CalDAV service
Select POP3/SMTP.
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 ('1970 @ qq.com '); $ mail-> SetFrom ("470356072@qq.com", "Network"); $ mail-> IsHTML (false ); $ mail-> Subject = "test email"; $ ma Il-> MsgHTML ("This is a test email! "); $ Mail-> Send (); if ($ mail-> Send () {echo" success ";}else {echo" false ";}?>