Solved

PHPmailer error Language string failed to load: from_failed

Posted on 2006-06-21
4
6,952 Views
Last Modified: 2008-01-09
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.php");
$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("toaddress");
$mail->AddReplyTo("myaddress", "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";
}
0
Comment
Question by:mit1290
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 

Expert Comment

by:NorwegianCoder
ID: 16979725
Looking into the code of phpmailer I see something in the SmtpSend() function:


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_failed") . $error;
            $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.
0
 

Author Comment

by:mit1290
ID: 16993636
I updated to isMAIL instead of isSMTP to use php built in mail function and that seemed to fix the issue, thanks.
0
 

Accepted Solution

by:
CetusMOD earned 0 total points
ID: 17257027
PAQed with points refunded (500)

CetusMOD
Community Support Moderator
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Query group by data in SQL Server - cursor? 3 86
convert Systemjs to Webpack 3 126
Crashing when deleting value with no child in Binary Tree 4 65
MySQL programmer starter 25 64
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
This is an explanation of a simple data model to help parse a JSON feed
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question