Php method 2 (SMTP transfer SMTP Class Call) _ PHP Tutorial

Source: Internet
Author: User
Tags email account
Php method 2 (SMTP transfer SMTP class call ). [Html]? Phprequire_once (email2.php); Method 2 for sending php mail (SMTP transmission SMTP class) *** server information *** $ MailServersmtp.163.com; SMTP server $ MailPort25; SMT [html]
Require_once ("email2.php"); // This is php method 2 (SMTP transmission SMTP class)
/**
* Server information
*/
$ MailServer = 'smtp .163.com '; // smtp server
$ MailPort = '25'; // The default SMTP server port number is 25.
$ MailId = 'anheng123 @ 163.com '; // server email account
$ MailPw = 'xxxxxxxxxxxxxx'; // server email password

/**
* Client information
*/
$ Title = 'system developers report error information'; // mail Title

$ Bt = "sadfsadf ";
$ _ POST ['URL'] = "afasdfasfasfsaf ";
$ _ POST ['liance'] = "12312412 ";
$ _ POST ['xiangsi'] = "isa in the first sentence, and I feel like I am modifying it ";
$ Td = $ subject .'
'.' Title: '. $ bt .'
'. 'URL:'. $ _ POST ['URL'].'
'.' Contact number: '. $ _ POST ['liance'].'
'.' Details: '. $ _ POST ['xiangsi'];



$ Content = $ td; // email Content
$ Email = www.2cto.com target recipient email


$ Smtp = new smtp ($ MailServer, $ MailPort, true, $ MailId, $ MailPw );
$ Smtp-> debug = false;
If ($ smtp-> sendmail ($ email, $ MailId, $ Title, $ Content, "HTML ")){
Echo 'email sent successfully'; // return result
} Else {
Echo 'email sending failed'; // $ succeed = 0;
}
?>
Author: Vericlongmore

Why? Php require_once (email2.php); // method 2. (SMTP transmission 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.