mit1290
asked on
PHPmailer error Language string failed to load: from_failed
I found someone who asked a similar question on this site but the accepted answer was for a windows server and I am running on Linux.
When I run the following code about ever other time I get the following error message:
Message was not sent Mailer Error: Language string failed to load: from_failedmyemail
If I hit refresh it goes through but obviously when I place this into my auto response I don’t want it to work only half the time.
require("class.phpmailer.p hp");
$mail = new PHPMailer();
$mail->IsSMTP(); // telling the class to use SMTP
$mail->IsHTML(true);
$mail->Host = "myhost"; // SMTP server
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->Username = "myuser"; // SMTP username
$mail->Password = "mypass"; // SMTP password
$mail->From = "fromaddress";
$mail->FromName = "Me";
$mail->AddAddress("toaddre ss");
$mail->AddReplyTo("myaddre ss", "me");
$mail->Subject = "email test";
$mail->Body = 'my html message';
if(!$mail->Send())
{
echo "Message was not sent";
echo "Mailer Error: " . $mail->ErrorInfo;
}
else
{
echo "Message has been sent";
}
When I run the following code about ever other time I get the following error message:
Message was not sent Mailer Error: Language string failed to load: from_failedmyemail
If I hit refresh it goes through but obviously when I place this into my auto response I don’t want it to work only half the time.
require("class.phpmailer.p
$mail = new PHPMailer();
$mail->IsSMTP(); // telling the class to use SMTP
$mail->IsHTML(true);
$mail->Host = "myhost"; // SMTP server
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->Username = "myuser"; // SMTP username
$mail->Password = "mypass"; // SMTP password
$mail->From = "fromaddress";
$mail->FromName = "Me";
$mail->AddAddress("toaddre
$mail->AddReplyTo("myaddre
$mail->Subject = "email test";
$mail->Body = 'my html message';
if(!$mail->Send())
{
echo "Message was not sent";
echo "Mailer Error: " . $mail->ErrorInfo;
}
else
{
echo "Message has been sent";
}
ASKER
I updated to isMAIL instead of isSMTP to use php built in mail function and that seemed to fix the issue, thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
if(count($bad_rcpt) > 0) // Create error message
{
for($i = 0; $i < count($bad_rcpt); $i++)
{
if($i != 0) { $error .= ", "; }
$error .= $bad_rcpt[$i];
}
$error = $this->Lang("recipients_fa
$this->SetError($error);
$this->smtp->Reset();
return false;
}
It could be that your email address seems to be a $bad_rcpt for phpmailer.
The function $smtp->Recipient($to) seems to check the address.
Please try another TO address.