PHP Mailer PHP email sending Function

Source: Internet
Author: User
Tags php email

Protected function Sendmail ($ userinfo) {</P> <p> Import ("yzlib. util. phpmailer "); <br/> Import (" yzlib. util. SMTP "); </P> <p> $ mail = new phpmailer (); <br/> $ mail-> issmtp (); // telling the class to use SMTP <br/> // $ mail-> smtpdebug = 1; // enables SMTP debug information (for testing) <br/> // 1 = errors and messages <br/> // 2 = messages only <br/> $ mail-> host = "smtpout.secureserver.net"; // SMTP serve R <br/> $ mail-> smtpauth = true; // enable SMTP authentication <br/> $ mail-> Port = 25; // set the SMTP port for the Gmail server <br/> $ mail-> fromname = "www.underabus.com"; <br/> $ mail-> username = "jian.zhao@dilitech.com "; // SMTP account username <br/> $ mail-> Password = "holiday"; // SMTP account password <br/> $ mail-> from = "jian.zhao@dilitech.com "; <br/> $ mail-> addreplyto ('jian. zhao@dilitech.co M', 'www .underabus.com '); </P> <p> $ mail-> subject = "your account details with www.underabus.com "; </P> <p> $ mail-> altbody = "dear ". $ userinfo-> firstname. "". $ userinfo-> familyname. ", thanks for registering with www.underabus.com. your username is :". $ userinfo-> email. "password is :". trim (Context: $ request-> getstring ('passwd ')). "Support Team www.underabus.com"; // optional, comment out and test </P> <p> // $ Mail-> msghtml ($ body); </P> <p> $ mail-> body = 'Demo '. $ userinfo-> firstname. ''. $ userinfo-> familyname. ': <br/> thanks for registering with <a href = "www.underabus.com" mce_href = "www.underabus.com"> www.underabus.com </a> <br/> <br /> <br/> your username is: '. $ userinfo-> email. '<br/> password is: <font color = "red"> '. trim (Context: $ request-> getstring ('passwd ')). '</font> <br/> <Br/> Support Team <br/> www.underabus.com <br/> '; </P> <p> $ mail-> addaddress ($ userinfo-> email, $ userinfo-> firstname. "". $ userinfo-> familyname); </P> <p> If (! $ Mail-> send () {</P> <p >}else {</P> <p >}< br/>

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.