PhpMailer: FeaturedemailtransferclassforPHPPHPMailer is a useful PHP mail class. It supports sending mails using the smtp server, and supports mail servers such as Sendmail, qmail, Postfix, Imail, Exchange, Mercury, and Courier. If the SMTP server is still phpMailer: Featured email transfer class for PHP
PHPMailer is a useful PHP mail class. It supports sending mails using the smtp server, and supports mail servers such as Sendmail, qmail, Postfix, Imail, Exchange, Mercury, and Courier. The SMTP server also supports authentication and multiple SMTP sending (but it is not clear what is the use ). email sending can include multiple TO, CC, BCC and REPLY-TO, supports text and HTML mail formats, can automatically wrap, supports attachments and images in various formats, customize the basic mail functions of the mail class.
Because PHP only contains one mail function, PHPMailer is greatly enhanced. I believe it can meet the needs of many people. It mainly includes two types of files: class. phpmailer. php for mail sending and class. smtp. php for smtp. There are also files that can implement multiple error outputs, as well as detailed documents. Software release follows the LGPL protocol.
It's easy to use. you can see the following example:
Require ("class. phpmailer. php ");
$ Mail = new PHPMailer ();
$ Mail-> IsSMTP (); // send via SMTP
$ Mail-> Host = "smtp1.site.com; smtp2.site.com"; // SMTP servers
$ Mail-> SMTPAuth = true; // turn on SMTP authentication
$ Mail-> Username = "jswan"; // SMTP username
$ Mail-> PassWord = "secret"; // SMTP password
'Www .cncms.com
$ Mail-> From = "from@email.com ";
$ Mail-> FromName = "Mailer ";
$ Mail-> AddAddress ("josh@site.com", "Josh Adams ");
$ Mail-> AddAddress ("ellen@site.com"); // optional name
$ Mail-> AddReplyTo ("info@site.com", "Information ");
$ Mail-> WordWrap = 50; // set word wrap
$ Mail-> AddAttachment ("/var/tmp/file.tar.gz"); // attachment
$ Mail-> AddAttachment ("/tmp/image.jpg", "new.jpg ");
$ Mail-> IsHTML (true); // send as HTML
$ Mail-> Subject = "Here is the subject ";
$ Mail-> Body = "This isHTML body";
$ Mail-> AltBody = "This is the text-only body ";
If (! $ Mail-> Send ())
{
Echo "Message was not sent
";
Echo "Mailer Error:". $ mail-> ErrorInfo;
Exit;
}
Echo "Message has been sent ";
For more information, see PHPMailer homepage: http://phpmailer.sourceforge.net/