Solved

PHPmailer error Language string failed to load: from_failed

Posted on 2006-06-21
4
6,834 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
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Here we come across an interesting topic of coding guidelines while designing automation test scripts. The scope of this article will not be limited to QTP but to an overall extent of using VB Scripting for automation projects. Introduction Now…
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

757 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now