PDA

View Full Version : PHPMailer and damned "The following recipients failed"



kern
06-18-2009, 10:09 AM
I try to send email with phpmailer, but sending on any address always leads to an error:

SMTP-> ERROR: RCPT not accepted from server:
SMTP Error: The following recipients failed:...

My code:

include ROOT .'/inc/phpmailer/class.phpmailer.php';
$mail = new PHPMailer();
$mail->PluginDir = ROOT .'/inc/phpmailer/';
$mail->SetLanguage('ru', ROOT . '/inc/phpmailer/language/');
$mail->IsSMTP();
$mail->SMTPDebug = 1;
$mail->SMTPAuth = true;
$mail->CharSet = 'cp1251';
$mail->From = $sets['subscribe_email'];
$mail->FromName = $sets['site_title'];
$mail->Host = $sets['smtp_host'];
$mail->Username = $sets['smtp_username'];
$mail->Password = $sets['smtp_password'];
$mail->Port = 26;
$mail->WordWrap = 50;
$mail->IsHTML(false);

...

$in['user_email'] = 'kern-dll@yandex.ru';

...

$mail->ClearAddresses();
$mail->AddAddress($in['user_email'], $in['username']);
$mail->AddReplyTo($in['user_email'], $in['username']);
$mail->Subject = 'Test subject';
$mail->Body = 'Test body';
if (!$mail->Send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
}

I'm use last version of PHPMailer - 5.0.2.

SMTP-settings are true, because in the e-mail client works perfectly.

Where a problem?

malefic
06-18-2009, 01:10 PM
Have you tried changing the port 26 to 25 just to test it - I know you say it works in an email client, but may be worth a go.

Cheers http://imgs.theimagesafe.info/cheers.gif
M.

kern
06-18-2009, 05:22 PM
No, if port 25, an error:

Could not connect to SMTP host

kern
06-19-2009, 05:17 AM
Today once the email has been sent, but after that again an error. WTF? Here there are limits by one IP or something?