Php Send mail method 22. (SMTP transport SMTP class call sent) _php tutorial

Source: Internet
Author: User
Tags php send mail server port
[HTML]
Require_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 messages '; Message header

$BT = "SADFSADF";
$_post[' url ']= "Afasdfasfasfsaf";
$_post[' Lianxi ']= "12312412";
$_post[' Xiangxi ']= "said the words head Isa and feel the change of";
$TD = $subject. '
'.' Title: '. $bt. '
'.' URL: '. $_post[' url ']. '
'.' Tel: '. $_post[' Lianxi ']. '
'.' Detailed content: '. $_post[' Xiangxi '];



$Content = $TD; Message content
$email = www.2cto.com 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 results
} else {
Echo ' failed to send mail '; $succeed = 0;
}
?>
Author: vericlongmore

http://www.bkjia.com/PHPjc/478150.html www.bkjia.com true http://www.bkjia.com/PHPjc/478150.html techarticle [HTML]? PHP require_once (email2.php);//This is for php send mail method 22. (SMTP transport SMTP Class)/** * Server information */$MailServer = smtp.163.com; SMTP server $MailPort = 25; SMT ...

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