Jump to content

PHP Mailer help (recipients_failed)


crazy manzaaa

Recommended Posts

Hi all,

I really need help to solve this problem. Does anyone ever experience the following error with phpMailer:

Mailer Error: Language string failed to load: recipients_failed

I use Apache 2.2.0 and PHP4.4.2. and only recently the email function on my website is broken and I got the above error message.  Below is the code that I have:

<CODE>

require("class.phpmailer.php");
require_once("class.smtp.php");
require_once('phpmailer.lang-en.php') ;

$mail = new PHPMailer();
$mail->IsSMTP();                                      // set mailer to use SMTP
$mail->Host = "<REMOVED>;<REMOVED>";  // specify main and backup server
$mail->SMTPAuth = true;    // turn on SMTP authentication
$mail->Username = "<REMOVED>";  // SMTP username
$mail->Password = "<REMOVED>"; // SMTP password
$mail->From = $email;
$mail->FromName = $name;
$mail->AddAddress('<REMOVED>');
$mail->WordWrap = 50;   
$mail->IsHTML(true);       
$mail->Subject = $subject;
$mail->Body    =  $message;
$mail->AltBody = "This is the body in plain text for non-HTML users";
$uploaddir = '<REMOVED>';
$uploadfile = $uploaddir . basename($_FILES['userfile']['name']);

echo '<pre>';
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
  $upload_ok = true;
} else {
  $upload_ok = false;
}
$mail->AddAttachment($uploadfile);
$mail->Send();

if(!$mail->Send())
{
  echo "Message was not sent <br />";
  echo "Mailer Error: " . $mail->ErrorInfo."<br />";
}
else
{
  echo "Message has been sent";
}

</CODE>

I wonder if anyone knows how to get around with this?  Any help would be greatly appreciated.

Thanks in advance!
Link to comment
Share on other sites

[code]Whats with this? You notice that your code is a lot smaller (font size wise) and that it looks like the:

echo '

';

Part of it isn't were is should it. Almost looks like it should be:

echo ' '; but that even seems incomplete.

I'm talking about below "$uploadfile = $uploaddir . basename($_FILES['userfile']['name']);"

btw- need to use [ code]text[/code] :)
Link to comment
Share on other sites

Thanks xAtlas.

Actually I figured out the problem already.  It is related to SMTP server naming, and once I changed the SMTP server it worked like a charm.  Too bad I spent so much time trying to debug the code :-[

And I will use [ code] next time.

Btw I'm new here and this forum looks very interesting.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.