php Send mail Step 22. (SMTP transport SMTP class call sent)

Source: Internet
Author: User
Tags php send mail
Php Send mail method 22. (SMTP transport SMTP class call sent)
<textarea readonly="" name="code" class="html"><?phprequire_once ("email2.php");//This is for PHP to send mail method 22. (SMTP transport SMTP Class)/*** Server information */$MailServer = ' smtp.163.com '; SMTP Server $mailport = ' 25 '; SMTP server port number Default 25$mailid = ' anheng123@163.com '; Server mailbox Account $MAILPW = ' xxxxxxxxxxx '; Server mailbox Password/*** client information */$Title = ' System Developer reports error message '; Message title $bt= "SADFSADF"; $_post[' url ']= "Afasdfasfasfsaf"; $_post[' Lianxi ']= "12312412"; $_post[' Xiangxi ']= " Say the head Isa and feel the change of "; $td = $subject. ' <br> '. ' Title: '. $bt. ' <br> ' URL: '. $_post[' url ']. ' <br> '. ' Tel: '. $_post[' Lianxi ']. ' <br> '. ' Detailed content: '. $_post[' Xiangxi '; $Content = $TD; e-mail content: ' chenlong@anheng.com.cn ';//target recipient Mailbox $smtp = new SMTP ($MailServer, $MailPort, True, $MailId, $MailPw); $smtp ->debug = False;if ($smtp->sendmail ($email, $MailId, $Title, $Content, "HTML")) {echo ' mail sent successfully '; Return result} else {echo ' message failed '; $succeed = 0;}? ></textarea>
  • 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.