Error message using PHP Mailer??

Associate
Joined
1 Jan 2007
Posts
355
Hi Guys,

Can you please help with a problem.

I installed PHPMailer & run a basic email script but I am getting this message: -

Message could not be sent.
Mailer Error: Language string failed to load: provide_address


I have placed the phpmailer.lang-en.php script in the same directory as the other mailer scripts & amended the script to include the recepients email address but still get the same message.

Any ideas on what I could be doing wrong?

Here is my tester script: -

<?php

require("class.phpmailer.php");

$mail = new PHPMailer();

$mail->IsSMTP(); // set mailer to use SMTP
$mail->Host = "example.btinternet.com"; // specify main and backup server
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->Username = "username"; // SMTP username
$mail->Password = "password"; // SMTP password

$mail->From = "Myemailaddress";
$mail->FromName = "Fromname";

$mail->WordWrap = 50; // set word wrap to 50 characters
$mail->IsHTML(true); // set email format to HTML

$mail->Subject = "Here is the subject";
$mail->Body = "This is the HTML message body <b>in bold!</b>";
$mail->AltBody = "This is the body in plain text for non-HTML mail clients";

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

echo "Message has been sent";
?>
 
Are you missing an provide_address entry inside the language file?

i.e.:

$PHPMAILER_LANG["provide_address"] = "Enter the address";
 
Last edited:
This is the first line in the language file of which I have entered my own email address already.

I do believe though I am missing the following line in my script: -

$mail->AddAddress("[email protected]");

But I can't get my head around how this effects it picking up the language file.
 
From Googling this may be your solution:


There is missing a call like
$mail->SetLanguage('en', '/path/to/the/directory/language/'); // of the mailer.

You need also the files from the language directory of phpmailer.
 
Back
Top Bottom