Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

PHPMailer error - Language string failed to load: recipients_failed someone@somewhere.com

Posted on 2006-07-23
3
29,799 Views
Last Modified: 2011-08-18
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@anywhere.com

Code:
<?php

require("class.phpmailer.php");

$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.com";
$mail->FromName = "This is my name";
$mail->AddAddress("test999@anywhere.com", "YourName");
$mail->AddReplyTo("test@legitimateaddress.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
0
Comment
Question by:davidcowler
  • 2
3 Comments
 
LVL 8

Accepted Solution

by:
RWJDCom earned 125 total points
ID: 17165216
Do you really need to use the SMTP server or can you use the systems internal mail function?  The problem is with the way PHPMailer is connecting to the SMTP server.  I knew that a lot of my systems use PHPMailer but I stick to using the servers 'mail' function to send the mail with PHPMAiler.

Try changing...

$mail->IsSMTP();                                      // set mailer to use SMTP

to

$mail->Mailer = "mail";

It will cause your script to work perfectly with the way that it is written using the systems internal mail function with PHPMailers features.
0
 
LVL 1

Author Comment

by:davidcowler
ID: 17170768
That does indeed work... and I have also tried the normal Mail function... but the issue I then get is that although the sender shows in the list of message in Outlook as the name I want it to, the preview (and message if fully opened) says it's from "nobody" (then my ISP's server address, then "on behalf of.... my address") which looks a little unprofessional. My ISP says that this is a security feature so that "from" addresses are not spoofed, and fair enough too, but it's annoying!

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
0
 
LVL 1

Author Comment

by:davidcowler
ID: 17259083
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.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Wordpress French and English Site 6 77
What's wrong with this PDO query? 5 27
How to check if a session is disconnected in php 9 32
Need to remove %20 from url in get 17 36
Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question