PHPmailer smtp GoDaddy проблема "SMTP -> ОШИБКА: ДАННЫЕ не принимаются с сервера" - PullRequest
2 голосов
/ 01 августа 2011

У меня проблема с отправкой почты через PHPmailer через SMTP.

Почта отправляется через 5 секунд, но все равно выдает ошибку:

SMTP -> ERROR: DATA not accepted from server

, нопочта отправляется, но через 5 секунд, и я считаю, что это связано со строкой из

class.phpmailer.php

public $Timeout       = 5;

, потому что, когда яустановите это значение в 10 секунд, оно будет ждать 10 секунд ...

Проблема заключается в том, когда я пытаюсь добавить якорную гиперссылку в html тела, например, если я пытаюсь отправить

<a>nonlink</a> <br> <b>bold text</b>

он отправляет почту без проблем и HTML-код в порядке, но когда я отправляю

<a href="http://www.google.com">nonlink</a> <br> <b>bold text</b>

, он выдает мне эту ошибку ....

мой код отправки:

/*SEND MAIL*/

//error_reporting(E_ALL);
//error_reporting(E_STRICT);
error_reporting(0);

date_default_timezone_set('America/Toronto');

require_once('../../library/class.phpmailer.php');
//include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded

$mail             = new PHPMailer();

$Link = '<a href="http://www.google.com">Confirm user</a>';


$body             = $Link;
/*$body             = eregi_replace("[\]",'',$body);*/

$mail->IsSMTP(); // telling the class to use SMTP
$mail->Host       = "smtpout.europe.secureserver.net"; // SMTP server
$mail->SMTPDebug  = 1;                   // enables SMTP debug information (for testing)
                                           // 1 = errors and messages
                                           // 2 = messages only
$mail->SMTPAuth   = true;                  // enable SMTP authentication
$mail->Host       = "smtpout.europe.secureserver.net"; // sets the SMTP server
$mail->Port       = 80;                    // set the SMTP port for the GMAIL server
$mail->Username   = "contact@mysite.com"; // SMTP account username
$mail->Password   = "thesecredpassword";        // SMTP account password

$mail->SetFrom('contact@mysite.com"', 'The name');


$mail->Subject    = "Account Confirmation";

$mail->AltBody    = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test

$mail->MsgHTML($body);

$address = $Username;
$mail->AddAddress($address, $Name);


if(!$mail->Send()) 
{
  /*echo "Mailer Error: " . $mail->ErrorInfo;*/
  $error = true;
  $MailHasBeenNotSended = true;
}
...