Phpmailer: PhP mail class library

Source: Internet
Author: User

Phpmailer is a PHP function package used to send emails. It provides the following functions:
* Specify multiple recipients, cc addresses, hidden addresses, and reply addresses when sending mail.
* Multiple email codes are supported, including 8bit, base64, binary, and quoted-printable.
*. Supports SMTP authentication.
*. Support for redundant SMTP servers
*. Supports attachments and HTML-format emails.
*. Customize the mail header
* Images can be embedded in emails.
* Flexible debugging
*. Compatible SMTP servers include sendmail, Qmail, Postfix, IMail, and exchange.
*. Can run on any platform

The following is an example of my phpmailer test. The SMTP server of Sina is used. Before using it, you must apply for an email address from Sina and activate SMTP/POP3 in the settings. This example also demonstrates the transmission of different simplified and complex internal codes and attachments.

<? PHP  Require_once 'Des/phpmailer/class. phpmailer. php' ;  $ Mail =New  Phpmailer ();  $ Mail -> Charset = "UTF-8" ;  $ Mail -> Issmtp ();  $ Mail -> Smtpauth = True  ;  $ Mail -> Host = "smtp.sina.com" ;  $ Mail -> Username = "amonest" ;  $ Mail -> Password = "XXXXX";  $ Mail -> Setfrom ('amonest @ Sina.com ', 'amonest' );  $ Mail -> Addaddress ('amonest @ Sina.com ', 'amonest' );  $ Mail -> Subject = 'test mail' ;  $ Mail -> Msghtml ('<B> hello, simplified, traditional ?!! </B>' );  $ Mail -> Addattachment ("license.txt" );  If (! $ Mail -> Send ()){  Echo "Mailer error :". $ Mail -> Errorinfo ;}  Else  {  Echo "Message sent! Congratulations, the email is sent successfully! " ;} 

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.