ISSMTP (); Use SMTP to send $mail->host = "smtp.qq.com"; Your enterprise Post office domain name $mail->smtpauth = true; Enable the SMTP authentication feature $mail->username = "963529987@qq.com"; Post Office User name (please fill in the full email address) $mail->password = "***********"; Post Office password $mail->port=25; $mail->from = "963529987@qq.com"; Email sender email Address $mail->fromname = "Liuyoubin"; $mail->addaddress ("$address", "a");//Recipient address, Can be replaced by any email message you want to receive, the format is addaddress ("Recipient Email", "Recipient Name")//$mail->addreplyto ("", ""); $mail->addattachment ("/var/tmp/file.tar.gz"); Add attachment//$mail->ishtml (TRUE); Set email format to HTML//whether to use HTML formatting $mail->subject = "phpmailer test mail"; Message title $mail->body = "Hello, this is Test mail"; U mail Content $mail->altbody = "This is the body in plain text for non-html mail clients"; For additional information, you can omit the IF (! $mail->send ()) {echo "Mail send failed."; echo" error Cause: ". $mail->errorinfo;exit;} echo "Mail sent successfully"; /*************************************************34 35 Accessories: 36phpmailer Chinese instruction (simplified version) 37A start: 38$ altbody--attribute 39 from: phpmailer::$ ALTBODY40 File: class.phpmailer.php41 Description: The setting of this property is an alternate display in the message body that does not support HTML 42addaddress--method 43 is derived from: phpmailer::addaddress (), File: CLASS.PHPMAILER.PHP44 Description: Add recipients. Parameter 1 is the recipient's mailbox, and Parameter 2 is the recipient's salutation. Example AddAddress ("eb163@eb163.com", "eb163"), but parameter 2 is optional, addaddress (eb163@eb163.com) is also possible. 45 function Prototype: Public function addaddress ($address, $name = ") {}46addattachment--method 47 from: Phpmailer::addattachment () 48 File: class.phpmailer.php. 49 Description: Add attachments. 50 Parameters: Path, name, encoding, type. Where the path is required, the other is an optional 51 function prototype: 52AddAttachment ($path, $name = ", $encoding = ' base64 ', $type = ' Application/octet-stream ') {} 53addbcc--method 54 from: PHPMAILER::ADDBCC () 55 File: Class.phpmailer.php56 Description: Add a secret send. For the difference between CC and BCC, see [the difference between BCC and CC in SMTP senders]. 57 Parameter 1 is the address, and parameter 2 is the name. Note This method only supports the use of SMTP under Win32 and does not support the Mail function 58 function prototype: Public function addbcc ($address, $name = ") {}59ADDCC--method 60 from: Phpmailer:: ADDCC () 61 File: class.phpmailer.php62 Description: Add a CC. For the difference between CC and BCC, see [the difference between BCC and CC in SMTP senders]. 63 Parameter 1For address, parameter 2 is name note This method supports SMTP only under Win32, does not support the Mail function 64 function prototype: Public function ADDCC ($address, $name = ") {} 65addcustomheader--method 66 from: Phpmailer::addcustomheader () 67 File: Class.phpmailer.php68 Description: Add a custom e-mail header. 69 parameter is header information 70 function prototype: Public function Addcustomheader ($custom _header) {}71addembeddedimage--method 72 from: Phpmailer:: Addembeddedimage () 73 File: class.phpmailer.php74 Description: Add an inline Picture 75 parameters: path, return handle [, Name, encoding, type]76 function prototype: public function Addembeddedimage ($path, $cid, $name = ', $encoding = ' base64 ', $type = ' Application/octet-stream ') {}77 hint: Addembeddedima GE (Picture_path. "Index_01.jpg", "img_01", "index_01.jpg"); 78 reference 79addreplyto--method in HTML 80 from: Phpmailer:: addrepl81******************* /82?>
Why send a message failed I'm using Phpmailer. Why send Failed
SMTP error:could not authenticate. Message delivery failed.
Error reason: SMTP error:could not authenticate.
SMTP Server Error:
Reply to discussion (solution)
Authentication failed. Check the code for authentication
Authentication failed. Check the authentication code where the code is ... I can't understand the code completely. Hey
$mail->username = "963529987@qq.com"; Post Office User name (please fill in the full email address)
$mail->password = "***********"; Post Office password
Under these two checks, the verification failed-the account number or password is wrong
To new registration 163 mailbox try, QQ mailbox seems to have restrictions
$mail->username = "963529987@qq.com"; Post Office User name (please fill in the full email address)
$mail->password = "***********"; Post Office password
Under these two checks, the verification failed-the account number or password is wrong
I wrote the code. I don't understand. What is the Post Office user name not the email address of the sender?
$mail->username = "963529987@qq.com"; Post Office User name (please fill in the full email address)
$mail->password = "***********"; Post Office password
Under these two checks, the verification failed-the account number or password is wrong
I wrote the code. I don't understand. What is the Post Office user name not the email address of the sender?
is the email address, you see the QQ mailbox SMTP has not opened.