IsSMTP (); email server $ mail-& gt; Host & quot; smtp.163.com & quot; $ mail-& gt; SMTPDebug0; use SMPT to verify $ mail-& gt; SMTPAuthtrue; SMTP authentication User Name $ mail-& gt; Username & quot; SMTP Authentication secret $ mail-& gt; Password & quot ;; set the encoding format $ mail-& gt; CharSet & php
Require_once ('./class. phpmailer. php ');
$ Mail = new PHPMailer ();
$ Body = "email sent successfully ";
// Use SMTP to send emails
$ Mail-> IsSMTP ();
// Email server
$ Mail-> Host = "smtp.163.com ";
$ Mail-> SMTPDebug = 0;
// Use SMPT for verification
$ Mail-> SMTPAuth = true;
// SMTP-verified user name
$ Mail-> Username = "";
// SMTP Authentication secret
$ Mail-> Password = "";
// Set the encoding format
$ Mail-> CharSet = "UTF-8 ";
// Set the topic
$ Mail-> Subject = "test ";
// Set the sender
$ Mail-> SetFrom ('***** @ 163.com', 'test ');
// Recipient's email name
$ Mail-> AddAddress ("*** @ 163.com"," test "); // send an email
If (! $ Mail-> Send ()){
Echo "Mailer Error:". $ mail-> ErrorInfo;
} Else {
Echo "Message sent! ";
}
?>
Where is the problem with this code ????