PHP MAILER Language string failed


#1

While using PHP MAILER, I get this error...
(note that jpdorto@hotmail.com is my email address)

Mailer Error: Language string failed to load:

  require("phpmailer/class.phpmailer.php");
$mail = new PHPMailer();
$mail->IsSMTP();                                   // send via SMTP
$mail->Host     = // SMTP servers
$mail->SMTPAuth = true;     // turn on SMTP authentication
$mail->Username = "pepe1";  // SMTP username
$mail->Password = "pepe"; // SMTP password
$mail->FromName = "Mailer";
$mail->WordWrap = 50;                              // set word wrap
$mail->IsHTML(true);                               // send as HTML
$mail->Subject  =  "Here is the subject";
$mail->Body     =  "This is the <b>HTML body</b>";
$mail->AltBody  =  "This is the text-only body";
if(!$mail->Send())
{
   echo "Message was not sent <p>";
   echo "Mailer Error: " . $mail->ErrorInfo;
   exit;
}
echo "Message has been sent";


#2

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;
        }

Your hotmail address seems to be a $bad_rcpt for phpmailer.

The function $smtp->Recipient($to) seems to check the address.

Please try another TO address.


#3

I put the following code:

$mail = new PHPMailer();

# I added SetLanguage like this
$mail->SetLanguage( 'en', 'phpmailer/language/' );

And it's work!


closed #4