正在向本地邮件服务器发送邮件 - “SENT: 550 地址无效。”
我正在尝试将邮件发送到我的本地邮件服务器。我使用 hMailServer 作为邮件服务器,并按照此处所述配置它:
在 XAMPP 上设置本地邮件(SMTP、POP3、IMAP)服务器
但是当我尝试发送邮件时,出现此错误:
( ! ) 警告:mail() [function.mail]: SMTP 服务器响应:550 地址无效。在 C:\wamp\www\kariyersitem\register.php 在线 161
邮件服务器的日志文件指示此错误如下:
"DEBUG" 3108 "2012-01-08 18:04:24.447" "Creating session 14"
"SMTPD" 3108 14 "2012-01-08 18:04:24.448" "127.0.0.1" "SENT: 220 localhost ESMTP"
"SMTPD" 1728 14 "2012-01-08 18:04:24.454" "127.0.0.1" "RECEIVED: HELO olcay-pc"
"SMTPD" 1728 14 "2012-01-08 18:04:24.455" "127.0.0.1" "SENT: 250 Hello."
"SMTPD" 3108 14 "2012-01-08 18:04:24.457" "127.0.0.1" "RECEIVED: MAIL FROM:<you@yourdomain>"
"SMTPD" 3108 14 "2012-01-08 18:04:24.458" "127.0.0.1" "SENT: 550 The address is not valid."
"SMTPD" 2040 14 "2012-01-08 18:04:24.459" "127.0.0.1" "RECEIVED: QUIT"
"SMTPD" 2040 14 "2012-01-08 18:04:24.460" "127.0.0.1" "SENT: 221 goodbye"
"DEBUG" 3392 "2012-01-08 18:04:24.461" "Closing TCP/IP socket"
"DEBUG" 3392 "2012-01-08 18:04:24.462" "Ending session 14"
我已检查地址,我确信它是正确的。
谁能告诉我有什么问题吗?
这是我的邮件代码:
$to = $frm_kadi;
$subject = $site_title.' Üyelik Aktivasyonu';
$message = 'hello';
$headers = 'From: '.$contact."\r\n".'Reply-To: '.$contact."\r\n".'X-Mailer: PHP/'.phpversion();
$mresult = mail($to, $subject, $message, $headers);
我已检查 $contact
并将其写为 [电子邮件受保护]
在我的 config.php
文件中。在发送邮件之前,我使用 echo 函数来调试我的代码,它是正确的。
目前我的 $contact 变量设置为:
$contact = "[email protected]";
UPDATE 1
将 sendmail_from
设置为 [email protected]
in php.ini
正如 @Jared Farrish 建议的解决了第一个问题。但现在我遇到了一个新问题:
"DEBUG" 3108 "2012-01-08 22:15:28.497" "Creating session 24"
"SMTPD" 3108 24 "2012-01-08 22:15:28.498" "127.0.0.1" "SENT: 220 localhost ESMTP"
"SMTPD" 3108 24 "2012-01-08 22:15:28.499" "127.0.0.1" "RECEIVED: HELO olcay-pc"
"SMTPD" 3108 24 "2012-01-08 22:15:28.500" "127.0.0.1" "SENT: 250 Hello."
"SMTPD" 4380 24 "2012-01-08 22:15:28.511" "127.0.0.1" "RECEIVED: MAIL FROM:<[email protected]>"
"DEBUG" 4380 "2012-01-08 22:15:28.542" "Total spam score: 0"
"SMTPD" 4380 24 "2012-01-08 22:15:28.547" "127.0.0.1" "SENT: 250 OK"
"SMTPD" 3108 24 "2012-01-08 22:15:28.548" "127.0.0.1" "RECEIVED: RCPT TO:<olcayertas>"
"SMTPD" 3108 24 "2012-01-08 22:15:28.548" "127.0.0.1" "SENT: 550 A valid address is required."
"SMTPD" 2040 24 "2012-01-08 22:15:28.552" "127.0.0.1" "RECEIVED: QUIT"
"DEBUG" 2040 "2012-01-08 22:15:28.552" "Deleting message file"
"SMTPD" 2040 24 "2012-01-08 22:15:28.552" "127.0.0.1" "SENT: 221 goodbye"
"DEBUG" 4380 "2012-01-08 22:15:28.555" "Closing TCP/IP socket"
"DEBUG" 4380 "2012-01-08 22:15:28.556" "Ending session 24"
似乎没有完全获取目标地址。我正在尝试向自己发送邮件,但它只收到用户名 olcayertas
且缺少域名 @gmail.com
。
更新2
我已经解决了第二个问题。这是我的错误。
更新3
现在我收到此错误:
"SENT: 530 SMTP authentication is required."
但我已经在设置->协议->SMTP->电子邮件传送->SMTP中继器下填写了SMTP身份验证设置
。选中服务器需要身份验证
和使用 SSL
选项。
更新4
在设置->高级->IP范围->我的电脑
中禁用hMailServer的需要 SMTPTP 身份验证
选项解决了 SMTP 身份验证问题。
I am trying to send mail to my local mail server. I am using hMailServer as mail server and I have configured it as mentioned here:
Setting up local Mail (SMTP, POP3, IMAP) Server on XAMPP
But when I try to send mail I am getting this error:
( ! ) Warning: mail() [function.mail]: SMTP server response: 550 The
address is not valid. in C:\wamp\www\kariyersitem\register.php on line
161
Log files of the mail server indicates this error as below:
"DEBUG" 3108 "2012-01-08 18:04:24.447" "Creating session 14"
"SMTPD" 3108 14 "2012-01-08 18:04:24.448" "127.0.0.1" "SENT: 220 localhost ESMTP"
"SMTPD" 1728 14 "2012-01-08 18:04:24.454" "127.0.0.1" "RECEIVED: HELO olcay-pc"
"SMTPD" 1728 14 "2012-01-08 18:04:24.455" "127.0.0.1" "SENT: 250 Hello."
"SMTPD" 3108 14 "2012-01-08 18:04:24.457" "127.0.0.1" "RECEIVED: MAIL FROM:<you@yourdomain>"
"SMTPD" 3108 14 "2012-01-08 18:04:24.458" "127.0.0.1" "SENT: 550 The address is not valid."
"SMTPD" 2040 14 "2012-01-08 18:04:24.459" "127.0.0.1" "RECEIVED: QUIT"
"SMTPD" 2040 14 "2012-01-08 18:04:24.460" "127.0.0.1" "SENT: 221 goodbye"
"DEBUG" 3392 "2012-01-08 18:04:24.461" "Closing TCP/IP socket"
"DEBUG" 3392 "2012-01-08 18:04:24.462" "Ending session 14"
I have checked address and I am sure it is correct.
Can anyone tell me what is the problem?
Here my mail code:
$to = $frm_kadi;
$subject = $site_title.' Üyelik Aktivasyonu';
$message = 'hello';
$headers = 'From: '.$contact."\r\n".'Reply-To: '.$contact."\r\n".'X-Mailer: PHP/'.phpversion();
$mresult = mail($to, $subject, $message, $headers);
I have checked $contact
and It is written as [email protected]
in my config.php
file. Before sending mail I have use echo function to debug my code and it is correct.
Currently my $contact variable is set to:
$contact = "[email protected]";
UPDATE 1
Setting sendmail_from
to [email protected]
in php.ini
as @Jared Farrish suggested solved the first problem. But now I have a new problem:
"DEBUG" 3108 "2012-01-08 22:15:28.497" "Creating session 24"
"SMTPD" 3108 24 "2012-01-08 22:15:28.498" "127.0.0.1" "SENT: 220 localhost ESMTP"
"SMTPD" 3108 24 "2012-01-08 22:15:28.499" "127.0.0.1" "RECEIVED: HELO olcay-pc"
"SMTPD" 3108 24 "2012-01-08 22:15:28.500" "127.0.0.1" "SENT: 250 Hello."
"SMTPD" 4380 24 "2012-01-08 22:15:28.511" "127.0.0.1" "RECEIVED: MAIL FROM:<[email protected]>"
"DEBUG" 4380 "2012-01-08 22:15:28.542" "Total spam score: 0"
"SMTPD" 4380 24 "2012-01-08 22:15:28.547" "127.0.0.1" "SENT: 250 OK"
"SMTPD" 3108 24 "2012-01-08 22:15:28.548" "127.0.0.1" "RECEIVED: RCPT TO:<olcayertas>"
"SMTPD" 3108 24 "2012-01-08 22:15:28.548" "127.0.0.1" "SENT: 550 A valid address is required."
"SMTPD" 2040 24 "2012-01-08 22:15:28.552" "127.0.0.1" "RECEIVED: QUIT"
"DEBUG" 2040 "2012-01-08 22:15:28.552" "Deleting message file"
"SMTPD" 2040 24 "2012-01-08 22:15:28.552" "127.0.0.1" "SENT: 221 goodbye"
"DEBUG" 4380 "2012-01-08 22:15:28.555" "Closing TCP/IP socket"
"DEBUG" 4380 "2012-01-08 22:15:28.556" "Ending session 24"
It seems like it does not get destination address completely. I am trying to send mail to myself but it gets only username olcayertas
and missing domain @gmail.com
.
UPDATE 2
I have solved the second problem. It was my mistake.
UPDATE 3
Now I am getting this error:
"SENT: 530 SMTP authentication is required."
But I have already filled SMTP authentication settings under Settings->Ptotocols->SMTP->Delivery of e-mail->SMTP Relayer
. Server requires authentication
and Use SSL
otions checked.
UPDATE 4
Disabling Require SMPTP authentication
options of hMailServer in Settings->Advanced->IP Ranges->My Compter
solved SMTP authentication problem.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
要解决
SENT: 550550 地址无效。
问题,您必须在php.ini
文件中将sendmail_from
设置为有效的邮件地址。要解决
SENT: 530 SMTPauthentication is required
问题,请打开hMailServer管理员。转至设置 -> 高级 -> IP 范围 -> 我的计算机。禁用“需要 SMTP 身份验证”部分下的所有选项。To solve
SENT: 550550 The address is not valid.
problem, you have to setsendmail_from
to a valid mail address inphp.ini
file.To solve
SENT: 530 SMTP authentication is required
problem, open hMailServer Administrator. Go to Settings->Advanced->IP Ranges->My Compter. Disable all options under "Require SMTP authentication" section.您似乎正在发送这样的“发件人”电子邮件(发件人标题):
you@yourdomain
。yourdomain
是无效域。将其更改为有效的电子邮件地址。It seems that you are sending the "sender"-email (From-Header) like this:
you@yourdomain
.yourdomain
is an invalid domain. Change this to a valid email-address.您使用
you@yourdomain
作为发件人地址,但服务器拒绝了它。请改用真实地址。
You're using
you@yourdomain
as the From address and the server rejects it.Use a real address instead.
我猜
$contact
是<[email ;受保护]>
和这就是造成问题的原因。尝试将其更改为[电子邮件受保护]
。I'm guessing
$contact
is<[email protected]>
and that's what's causing the problem. Try changing it to[email protected]
.请记住,每次更改 php.ini 后,
都应该重新启动 wamp(!!!)
以读取更新的 php.ini
。您可能需要使用 ini_set("sendmail_from", "[电子邮件受保护]< /a>"); 在你的 php 脚本中,之前 邮件();
KEEP IN MIND, every time, after You change php.ini,
you should restart wamp (! ! !)
to read the updated php.ini
p.s. you may need to use
ini_set("sendmail_from", "[email protected]");
in your php script, before mail();