Page 1 of 1

[SOLVED] PHPMailer returning "Mailer Error: Language st

Posted: Fri Mar 09, 2007 8:01 am
by impulse()
The full error is:

"Mailer Error: Language string failed to load: provide_address".

Althought I've printed out the to, from, reply, subject & body and they're all being passed to PHPMailer correctly. Google isn't much help in this situation either.

I'm using the following code to try to send:

Code: Select all

$to      = $_POST["to"];
  $subject = $_POST["subject"];
  $message = $_POST["message"];

  $mail = new PHPMailer();

  $mail->IsSMTP();
  $mail->Host       = "x";
  $mail->From       = $cppEmail;
  $mail->FromName   = $cppfName." ".$cppsName;
  $mail->AddAddress = $to;
  $mail->AddReplyTo = $cppEmail;

  $mail->Subject    = $subject;
  $mail->Body       = $message;
  $mail->AltBody    = "Test";
  $mail->WordWrap   = 50;

  $mail->Send();

  echo "<br><b>To:</b> {$mail->AddAddress}<br><b>From:</b>{$mail->From}<br><b>From Name: </b>{$mail->FromName}<br>";

  if(!$mail->Send()) {
    echo "Message was not sent <p>";
    echo "Mailer Error: " . $mail->ErrorInfo;
    exit;
  }
}

Regards,

Posted: Fri Mar 09, 2007 8:08 am
by volka
Did you test the script with the appropriate error reporting settings? If not, why not?
It's looking $PHPMAILER_LANG["provide_address"] and can't find it.

Posted: Fri Mar 09, 2007 8:11 am
by impulse()
I've placed

Code: Select all

error_reporting(E_ALL);
at the top of my script but there's no additional information from what PHPMailer supplied.

Posted: Fri Mar 09, 2007 8:14 am
by impulse()
Even if it does find it, it will report:

$PHPMAILER_LANG["provide_address"] = 'You must provide at least one ' .
'recipient email address.';

As far as I can see, I have provided a recipient address. Can you see otherwise?

Posted: Fri Mar 09, 2007 8:23 am
by volka
impulse() wrote:$mail->AddAddress = $to;
AddAddress is a function not a property

Posted: Fri Mar 09, 2007 8:26 am
by impulse()
Very helpful, as always.

Regards,