[SOLVED] PHPMailer returning "Mailer Error: Language st

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
impulse()
Forum Regular
Posts: 748
Joined: Wed Aug 09, 2006 8:36 am
Location: Staffordshire, UK
Contact:

[SOLVED] PHPMailer returning "Mailer Error: Language st

Post 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,
Last edited by impulse() on Fri Mar 09, 2007 8:26 am, edited 1 time in total.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post 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.
impulse()
Forum Regular
Posts: 748
Joined: Wed Aug 09, 2006 8:36 am
Location: Staffordshire, UK
Contact:

Post 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.
impulse()
Forum Regular
Posts: 748
Joined: Wed Aug 09, 2006 8:36 am
Location: Staffordshire, UK
Contact:

Post 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?
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

impulse() wrote:$mail->AddAddress = $to;
AddAddress is a function not a property
impulse()
Forum Regular
Posts: 748
Joined: Wed Aug 09, 2006 8:36 am
Location: Staffordshire, UK
Contact:

Post by impulse() »

Very helpful, as always.

Regards,
Post Reply