davidcowler
asked on
PHPMailer error - Language string failed to load: recipients_failed someone@somewhere.com
Hi. I saw PHPMailer recommened on this site so I'm now trying to use it. However, I'm getting the above error message. All I've done so far is take the example code and changed it to suit my ISP as shown below (Some bits, obviously, changed for secrity reasons - all email addresses being used in my code are real).
Error reads:
Mailer Error: Language string failed to load: recipients_test999@anywher e.com
Code:
<?php
require("class.phpmailer.p hp");
$mail = new PHPMailer();
$mail->IsSMTP(); // set mailer to use SMTP
$mail->Host = "smtp.mydomain.com"; // specify main and backup server
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->Username = "myname"; // SMTP username
$mail->Password = "mypass"; // SMTP password
$mail->From = "test@legitimateaddress.co m";
$mail->FromName = "This is my name";
$mail->AddAddress("test999 @anywhere. com", "YourName");
$mail->AddReplyTo("test@le gitimatead dress.com" , "Test");
$mail->WordWrap = 50; // set word wrap to 50 characters
$mail->IsHTML(true); // set email format to HTML
$mail->Subject = "This is a test message";
$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";
?>
Thanks in advance for help and advice :)
DC
Error reads:
Mailer Error: Language string failed to load: recipients_test999@anywher
Code:
<?php
require("class.phpmailer.p
$mail = new PHPMailer();
$mail->IsSMTP(); // set mailer to use SMTP
$mail->Host = "smtp.mydomain.com"; // specify main and backup server
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->Username = "myname"; // SMTP username
$mail->Password = "mypass"; // SMTP password
$mail->From = "test@legitimateaddress.co
$mail->FromName = "This is my name";
$mail->AddAddress("test999
$mail->AddReplyTo("test@le
$mail->WordWrap = 50; // set word wrap to 50 characters
$mail->IsHTML(true); // set email format to HTML
$mail->Subject = "This is a test message";
$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";
?>
Thanks in advance for help and advice :)
DC
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
My provider says there's no way around it as it's how their servers handle emails. Never mind, what I now have with your help, RWJDCom, serves the purpose well.
ASKER
If i can get PHPMailer to work, I assume that it doesn't do the "on behalf of" because it has the email account login details to hand?
My site will be sending various mails back to the office, so I'm not worried about it in this case, but when auto-emailing customers it would look a bit shoddy... any way round it?
Thanks
DC