Olc*_*taş 9 php email local mail-server
我正在尝试将邮件发送到我的本地邮件服务器.我使用hMailServer作为邮件服务器,我已按照此处的说明进行配置:
在XAMPP上设置本地邮件(SMTP,POP3,IMAP)服务器
但是当我尝试发送邮件时,我收到此错误:
(!)警告:mail()[function.mail]:SMTP服务器响应:550地址无效.在第161行的C:\ wamp\www\kariyersitem\register.php中
邮件服务器的日志文件指示此错误如下:
"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"
Run Code Online (Sandbox Code Playgroud)
我检查了地址,我确信它是正确的.
谁能告诉我这是什么问题?
这是我的邮件代码:
$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);
Run Code Online (Sandbox Code Playgroud)
我已经检查过$contact,它写olcayertas@gmail.com在我的config.php文件中.在发送邮件之前,我使用echo函数来调试我的代码,这是正确的.
目前我的$ contact变量设置为:
$contact = "olcayertas@gmail.com";
Run Code Online (Sandbox Code Playgroud)
更新1
设置sendmail_from要olcayertas@gmail.com在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:<olcayertas@gmail.com>"
"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"
Run Code Online (Sandbox Code Playgroud)
好像它没有完全获得目标地址.我正在尝试向自己发送邮件,但它只获取用户名olcayertas和缺少域名@gmail.com.
更新2
我已经解决了第二个问题.这是我的错.
更新3
现在我收到此错误:
"SENT: 530 SMTP authentication is required."
Run Code Online (Sandbox Code Playgroud)
但我已经填写了SMTP身份验证设置Settings->Ptotocols->SMTP->Delivery of e-mail->SMTP Relayer.Server requires authentication和Use SSLotions检查.
更新4
Require SMPTP authentication在Settings->Advanced->IP Ranges->My Compter解决的SMTP身份验证问题中禁用hMailServer的选项.
Olc*_*taş 12
要解决SENT: 550550 The address is not valid.问题,您必须sendmail_from在php.ini文件中设置有效的邮件地址.
要解决SENT: 530 SMTP authentication is required问题,请打开hMailServer Administrator.转到设置 - >高级 - > IP范围 - >我的计算器.禁用"要求SMTP身份验证"部分下的所有选项.