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