Php application PHPMailer

Source: Internet
Author: User
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 ";}?>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.