Home  >  Article  >  Backend Development  >  2013/8/29 TP Send Email <Techniques>_PHP Tutorial

2013/8/29 TP Send Email <Techniques>_PHP Tutorial

WBOY
WBOYOriginal
2016-07-20 11:15:49862browse

1. Import the class file mail and create the object

import('ORG.Com.Phpmailer');

$mail=new PHPMailer();

2. Setting information

$mail->IsSMTP(); //Set up to use SMTP server to send
$mail->Host = "smtp.126.com"; //Set up 126 mailbox service
$mail-> ;SMTPAuth = true; /Set sender password

$mail->From = "heitiane@126.com"; // Sender's email address

$mail->FromName = "yishiwang"; // Sender's name

$mail ->AddAddress('666@qq.com'); //Add sending address

$mail->IsHTML(true); //Specify support for html format
$mail->CharSet ="UTF-8"; //Specify character set

$mail->Subject = "Activate account"; //Mail title
$mail->Body = "Account Already activated, click to jumplocalhost/demo.jpg"; //Email content, you can add tags

3. Send email, return true if successful and false if failed

$mail->Send();

http://www.bkjia.com/PHPjc/440153.html

truehttp: //www.bkjia.com/PHPjc/440153.htmlTechArticle1. Import the class file mail and create the object import('ORG.Com.Phpmailer'); $mail= new PHPMailer(); 2. Set information $mail-IsSMTP(); //Set to use SMTP server to send $mail-Host = "smtp.126....
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn