Ec (2); & nbsp; email sending is a frequently used function, but php's default support is not very good. Here we will introduce a good open-source module: phpmailer, this module provides comprehensive functions and supports SMTP verification. The following describes how to use it: 1. Download The phpmailer module: & nbsp; official website www. phpdoc. org2 decompress to a folder 3. The php file contains require script ec (2) and script
Sending mail is a frequently used function, but php does not support it well by default. Here we will introduce a good open-source module: phpmailer, which provides comprehensive functions and supports SMTP verification. The following describes how to use it:
1 download phpmailer module: Official Website http://www.phpdoc.org/
2. decompress the package to a folder.
3. The php file contains require_once ("class. phpmailer. php ");
4. Use SMTP to send Emails:
$ Mail = new PHPMailer (); // get a PHPMailer instance
$ Mail-> CharSet = "gb2312"; // sets the gb2312 Chinese encoding.
$ Mail-> IsSMTP (); // you can use SMTP to send emails.
$ Mail-> Host = "192.168.1.27"; // set the email server address
$ Mail-> Port = 25; // set the mail server Port. The default value is 25.
$ Mail-> From = "mailFrom@tencent.com"; // set the sender's email address
$ Mail-> FromName = "samzhang"; // you can specify the sender's name.
// $ Mail-> SMTPAuth = true; // sets whether password verification is required for SMTP. true indicates that password verification is required.
$ Mail-> Username = "samzhang ";
$ Mail-> Password = ''your password ";
$ Mail-> Subject = $ subject; // you can specify the mail title.
$ Mail-> AltBody = "text/html"; // optional, comment out and test
$ Mail-> Body = "your email content ";
$ Mail-> IsHTML (</