Phpmailer simple way to send mail (with Phpmailer source download), Phpmailer source Download _php Tutorial

Source: Internet
Author: User
Tags server port

Phpmailer simple way to send mail (with Phpmailer source download), Phpmailer source download


This article describes the Phpmailer simple way to send a message. Share to everyone for your reference, as follows:

First, click here Download the site the appropriate php file .

After decompression there are 2 PHP files (2 classes) 1 HTML files (API)

Putting 2 php files into a PHP project

Description: I am here to send a message to 126 with a 163 mailbox

The key code is as follows:

<?php  require ' class.phpmailer.php ';  $mail = new Phpmailer (true); Establish the Mail sending class  $mail->charset = "UTF-8";//Set the encoding type of information  $address = "******@126.com";//Recipient address  $mail->ISSMTP (); Use SMTP to send  $mail->host = "smtp.163.com";//Use 163 mailbox server  $mail->smtpauth = true;//Enable SMTP Authentication feature  $ Mail->username = "******@163.com"; Your 163 server mailbox account  $mail->password = "******";//163 mailbox Password  $mail->port = 25;//Mailbox Server port number  $mail->from = "******@163.com"; Email Sender email address  $mail->fromname = "Test Mail",//Sender name  $mail->addaddress ("$address", "Zhang San");//Recipient address, Can be replaced with any email message you want to receive, in the form addaddress ("Recipient Email", "Recipient Name")  $mail->addattachment ("D:\abc.txt");//Add attachments ( Note: The path cannot have Chinese)  $mail->ishtml (TRUE);//whether to use HTML format  $mail->subject = "test test";//message header  $mail->body = "Happy New Year"; The message content, set HTML above, it can be HTML  if (! $mail->send ()) {   

"; echo "Error Reason:". $mail->errorinfo; Exit; }? >

I hope this article is helpful to you in PHP programming.

http://www.bkjia.com/PHPjc/1136643.html www.bkjia.com true http://www.bkjia.com/PHPjc/1136643.html techarticle Phpmailer simple way to send mail (with Phpmailer source download), Phpmailer Source Download This example tells the Phpmailer simple way to send mail. Share to everyone for reference, with ...

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