I am using php mailer class to send email to my customers. But it failed with error:
Language string failed to load: recipients_failed example@gmail.com
If I change the values of $email_to and $email_from to the same email address, then the email is sent successful
This is my code for sending the email
$email_to = "example@gmail.com";
$email_subject = "bla bla";
$email_from = 'info@domain.com.vn';
$email_message = "hello there";
$mail = new PHPMailer();
$mail->CharSet="UTF-8";
$mail->IsSMTP(); // telling the class to use SMTP
$mail->Host = "mail.domain.com.vn"; // SMTP server
$mail->From = $email_from;
$mail->AddAddress($email_to);
$mail->AddReplyTo($email_from);
$mail->Subject = $email_subject;
$mail->WordWrap = 100;
$mail->Body = $htmlBody;
$mail->isHTML(true);
$mail->AltBody = $email_message;
if(!$mail->Send()){
echo $mail->ErrorInfo;
}
So it will always report error unless I change $email_to to info@domain.com.vn
Thank you,
Note : Please change the SMTP server setting to your own server.