Mailer Error: Language string failed to load: from_failedmailangel123@163.com,
This problem suddenly occurs when I regularly send an email to a member [phpmailer]. After careful analysis, I found that the username and password are incorrect. The following is a function that can indeed send emails.
Nclude_once ("../pmail/class. phpmailer. php ");
Smtp_mail ();
Function smtp_mail (){
$ Mail = new PHPMailer ();
$ Mail-> IsSMTP (); // send via SMTP
$ Mail-> Host = "smtp.163.com"; // SMTP servers
$ Mail-> SMTPAuth = true; // turn on SMTP authentication
$ Mail-> Username = "mailangel123"; // SMTP username note: @ domain name is not required for normal mail authentication.
$ Mail-> Password = "*******"; // SMTP password
$ Mail-> From = "mailangel123@163.com"; // sender's mailbox
$ Mail-> FromName = "Hello, you haven't been here for a long time"; // sender
$ Mail-> CharSet = "GB2312"; // The character set is specified here!
$ Mail-> Encoding = "base64 ";
$ Mail-> AddAddress ("mailangel123@163.com", "test"); // recipient's mailbox and name
$ Mail-> AddReplyTo ("mailangel123@163.com", "163.com ");
$ Mail-> IsHTML (true); // send as HTML
$ Mail-> Subject = 'Hello, you haven't been here for a long time! '; // Email subject
$ Mail-> Body = "test content"; // mail content
$ Mail-> AltBody = "text/html ";
$ Mail-> Send ();
If (! $ Mail-> Send ())
{
Echo "Message cocould not be sent. <p> ";
Echo "Mailer Error:". $ mail-> ErrorInfo;
Exit;
}
Echo "Message has been sent ";
}
Change mailangel to your own email address.