2013/8/29 tp Send mail < tips class >_php Tutorial

Source: Internet
Author: User
1. Import the class file mail and create the object

Import (' ORG.Com.Phpmailer ');

$mail =new Phpmailer ();

2. Setting up information

$mail->issmtp (); Settings are sent using the SMTP server
$mail->host = "smtp.126.com"; Set up 126 mailbox service
$mail->smtpauth = true; Settings need to be validated
$mail->username = "kongxiangshuaihe@126.com"; Senders Use Mailboxes
$mail->password = "538567"; Set Sender Password

$mail->from = "heitiane@126.com"; Sender Mailbox
$mail->fromname = "Yi Time Net"; Sender Name
$mail->addaddress (' 666@qq.com '); Add Send Address

$mail->ishtml (TRUE); Specify HTML format support
$mail->charset= "UTF-8"; Specifying a character Set

$mail->subject = "Activate account"; Message header
$mail->body = " account has been activated, click Jump Localhost/demo.jpg";//mail content, can be tagged

3. Send message, successful return true failed False

$mail->send ();

http://www.bkjia.com/PHPjc/440153.html www.bkjia.com true http://www.bkjia.com/PHPjc/440153.html techarticle 1. Import the class file mail and create the object import (' ORG.Com.Phpmailer '); $mail =new Phpmailer (); 2. Set the information $mail-issmtp (); Set to send $mail-host = "smtp.126 ...." Using the SMTP server .

  • 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.