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
impulse()
Forum Regular
Posts: 748 Joined: Wed Aug 09, 2006 8:36 am
Location: Staffordshire, UK
Contact:
Post
by impulse() » Fri Mar 09, 2007 8:01 am
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.
volka
DevNet Evangelist
Posts: 8391 Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger
Post
by volka » Fri Mar 09, 2007 8:08 am
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() » Fri Mar 09, 2007 8:11 am
I've placed
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() » Fri Mar 09, 2007 8:14 am
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?
volka
DevNet Evangelist
Posts: 8391 Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger
Post
by volka » Fri Mar 09, 2007 8:23 am
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() » Fri Mar 09, 2007 8:26 am
Very helpful, as always.
Regards,