Step 2 (SMTP transfer SMTP Class Call)

Source: Internet
Author: User
Tags email account
Php method 2 (SMTP transfer SMTP Class Call) & lt ;? Phprequire_once (& quot; email2.php & quot;); Method 2 for sending an email to php. (SMTP transmission class) *** server information ** $ MailServersmtp.163.com; SMTP server $ MailPort25; php method 2 for sending mail. (SMTP transfer SMTP Class Call sending)
<? Phprequire_once ("email2.php"); // method 2. (SMTP transmission SMTP class)/*** server information */$ MailServer = 'smtp .163.com '; // smtp server $ MailPort = '25 '; // SMTP server port 25 $ MailId = 'anheng123 @ 163.com 'by default; // 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 header of the statement, and I feel like this"; $ td = $ subject. '<br> '. 'Title :'. $ bt.' <Br> '. 'URL :'. $ _ POST ['URL']. '<br> '. 'contact number :'. $ _ POST ['liance']. '<br> '. 'details :'. $ _ POST ['xiangsi']; $ Content = $ td; // email Content $ email = 'chenlong @ anheng.com.cn '; // target receiver email $ 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 'email sending failed'; // $ succeed = 0 ;}?>

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.