邮件错误:SMTP错误:数据未被接受 [英] Mailer Error: SMTP Error: data not accepted

查看:672
本文介绍了邮件错误:SMTP错误:数据未被接受的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想通过PHP发送邮件,所以我正在使用PHPMailer。不知道为什么我收到这个错误。


Mailer错误:SMTP错误:数据未被接受.SMTP服务器错误:DATA END命令失败详细信息:不允许继承 - 发件人域不是本地SMTP代码:530


这是我的代码。

  require'../library/PHPMailer/PHPMailerAutoload.php'; 
$ mail = new PHPMailer;
$ mail-> IsSMTP();
//从电子邮件地址和名称
$ mail-> From =my@email.address;
$ mail-> FromName =全名;

//寻址并命名
$ mail-> addAddress(my@email.address,收件人名称);
//$mail->addAddress(\"recepient1@example.com); //收件人名称是可选的

//收件人回复的地址
$ mail-> addReplyTo(p.archish@live.com,回复);



//发送HTML或纯文本电子邮件
$ mail-> isHTML(true);

$ mail-> Subject =Subject Text;
$ mail-> Body =< i> HTML中的邮件正文< / i>;
// $ mail-> AltBody =这是电子邮件内容的纯文本版本;

如果(!$ mail-> send())
{
echoMailer Error:。 $ MAIL-> ERRORINFO;
}
else
{
echo消息已成功发送;
}

任何帮助或建议?我不在本地执行这个代码,它在服务器上。

解决方案

服务器允许发送没有验证是不寻常的。我建议设置主机,SMTPAuth,用户名和密码属性,如PHPMailer show所提供的示例。


I want to send mail through PHP, so i am using PHPMailer. Don't know why i am getting this error.

Mailer Error: SMTP Error: data not accepted.SMTP server error: DATA END command failed Detail: Relaying not allowed - sender domain not local SMTP code: 530

This is my code.

require '../library/PHPMailer/PHPMailerAutoload.php';
$mail = new PHPMailer;
$mail->IsSMTP();
//From email address and name
$mail->From = "my@email.address";
$mail->FromName = "Full Name";

//To address and name
$mail->addAddress("my@email.address", "Recipient Name");
//$mail->addAddress("recepient1@example.com"); //Recipient name is     optional

//Address to which recipient will reply
$mail->addReplyTo("p.archish@live.com", "Reply");



//Send HTML or Plain Text email
$mail->isHTML(true);

$mail->Subject = "Subject Text";
$mail->Body = "<i>Mail body in HTML</i>";
//$mail->AltBody = "This is the plain text version of the email content";

if(!$mail->send()) 
{
    echo "Mailer Error: " . $mail->ErrorInfo;
} 
else 
 {
   echo "Message has been sent successfully";
}

Any help or suggestion? and i am not executing this code on local, it's on server.

解决方案

It's unusual for a server to allow sending without authentication. I suggest setting the Host, SMTPAuth, Username and Password properties, as the examples provided with PHPMailer show.

这篇关于邮件错误:SMTP错误:数据未被接受的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆