The main functional features and simple use instructions of Phpmailer

Source: Internet
Author: User
Tags php file set time port number server port

  This article is mainly on the main features of Phpmailer and simple use of the instructions are introduced, the need for friends can come to the reference, I hope to help you.

Support Message S/MIME encrypted digital signature   support mail multiple TOs, CCs, BCCs and reply-tos  can work on any server platform, so don't worry about the win platform can't send mail questions   support text/ HTML-formatted messages   can embed image images   support for mail clients that do not support HTML reading   powerful send-mail debugging features debug  custom mail header  redundant SMTP server support   Support 8bit, base64, binary, and quoted-printable code   text line   support for multiple attachment Send function   Support SMTP server authentication function   in SendMail, QMail, Postfix, Gmail, Imail, Exchange and other platform test success   download files, including detailed documentation and sample instructions, so don't worry about the difficult problem!   Phpmailer is very small, simple, convenient, fast     Phpmailer use (here to use Gmail smtp send mail as an example, of course, support sendmail  pop, etc.): first to HTTP :// the latest version of the package   download completed, find class.phpmailer.php, class.smtp.php two classes into their own directory!   Then create a new PHP file here named:phpmail.php  phpmail.php content as follows:  I directly send the email module as a function postmail (), we use the time to call the function directly, The function content is:   program code     code as follows: function Postmail ($to, $subject = "", $body = "") {   //$to represents the recipient address $subjec T indicates that the message header $body represents the message body    //error_reporting (E_all);     error_reporting (e_strict);   &nbsp Date_default_timezone_set ("Asia/shanghai")/Set time zone East eight area     require_once (' class.phpmailer.php ');     include ("class.smtp.php");      $mail             = new Phpmail ER (); New a Phpmailer object out     $body             = Eregi_replace ("[]", ", $body); Make the necessary filter     $mail->charset = "UTF-8";/Set message encoding, default iso-8859-1, if the Chinese must be set up, otherwise garbled     $mail- >ISSMTP (); Set up to use SMTP service     $mail->smtpdebug  = 1;                    //Enable SMTP debugging features       &NB     Sp                                //1 = Erro RS and messages                               & nbsp            //2 = messages only     $mail-&Gt Smtpauth   = true;                  //Enable SMTP authentication function     $mail->smtpsecure = "SSL";                //security protocol     $mail->host       = "SMTP. ";      //SMTP server     $mail->port       = 465;                  //SMTP server port number     $mail->username   = "S MTP Server user name ";  //SMTP Server user name     $mail->password   = "SMTP server password";            //SMTP server password     $mail->setfrom (' sender address, such as ', ' Sender name ' );     $mail->addreplyto ("Mail reply address, such as", "Name of mail reply person");     $mail->subject    = $subject;     $mail->altbody    = "To view", please use an HTML compatible email viewer! "; Optional, comment out and test   &NBsp $mail->msghtml ($body);     $address = $to;     $mail->addaddress ($address, "Recipient name");    //$mail->addattachment ("Images/phpmailer.gif");      //attachment     //$mail->addattachment ("Images/phpmailer_mini.gif"); Attachment     if (! $mail->send ()) {        echo "Mailer Error:". $mail->errorinfo;    } else {        echo "message sent! Congratulations, Mail sent successfully! ";        }    }    
Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

11.11 Big Sale for Cloud

Get Unbeatable Offers with up to 90% Off,Oct.24-Nov.13 (UTC+8)

Get It Now >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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: and provide relevant evidence. A staff member will contact you within 5 working days.