使用此:
require("lib/class.phpmailer.php");
$mail = new PHPMailer();
$mail->Username = "XXX@validGoDaddyAccount.com";
$mail->Password = "xxx";
$mail->Subject = $subject;
$mail->Body= $message;
$mail->AddAddress($toAddr);
$mail->FromName = "XXXXXXXXXXXX";
$mail->IsSMTP();
$mail->SMTPDebug = 2;
$mail->Host = "smtpout.secureserver.net";
$mail->Port = 465;
$mail->SMTPSecure = "ssl";
$mail->SMTPAuth = true;
$mail->From = $mail->Username;
$mail->IsHTML(true);
if(!$mail->Send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
} else {
return true;
}
我收到了这个回复:
SMTP -> FROM SERVER:220 p3plsmtpa07-05.prod.phx3.secureserver.net ESMTP
SMTP -> FROM SERVER: 250-p3plsmtpa07-05.prod.phx3.secureserver.net hello [00.00.0.0], secureserver.net 250-HELP 250-AUTH LOGIN PLAIN 250-SIZE 31457280 250-PIPELINING 250-8BITMIME 250 OK
SMTP -> FROM SERVER:550 User XXX has exceeded their send quota
SMTP -> ERROR: MAIL not accepted from server: 550 User XXX has exceeded their send quota
The following From address failed: XXX : MAIL not accepted from server,550,User XXXm has exceeded their send quota
SMTP server error: User XXX has exceeded their send quota
Mailer Error: The following From address failed: XXX : MAIL not accepted from server,550,User XXX has exceeded their send quota
SMTP server error: User XXX has exceeded their send quota
我知道为GoDaddy帐户设置SMTP Relays并且设置正确。只要我不使用PHPmailer,我就可以整天从这个帐户发送电子邮件。
答案 0 :(得分:1)
请参阅以下一行
SMTP -> FROM SERVER:550 User XXX has exceeded their send quota
这就是它拒绝的原因。
答案 1 :(得分:0)
解决方案是我需要在启动SMTP操作之前使用POP进行预授权:
require("lib/class.phpmailer.php");
require_once('lib/class.pop3.php');
$pop = new POP3();
$pop->Authorise('pop.server.net', 110, 30, 'username', 'password', 1);
$mail = new PHPMailer();
...