Jump to content


Photo

PHP Mailer help (recipients_failed)


  • Please log in to reply
2 replies to this topic

#1 crazy manzaaa

crazy manzaaa
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 11 August 2006 - 06:02 PM

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!


#2 xAtlas

xAtlas
  • Members
  • PipPip
  • Member
  • 18 posts

Posted 11 August 2006 - 06:35 PM

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
:)

#3 crazy manzaaa

crazy manzaaa
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 11 August 2006 - 10:23 PM

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.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users