2012-04-03 79 views
0

我使用PHP和邮件功能,但我面对这样的错误:警告:电子邮件()[function.mail]:SMTP服务器响应:550

Warning: mail() [function.mail]: SMTP server response: 550 No such user here in C:\inetpub\vhosts\saj.ir\subdomains\lms\httpdocs\registration\include.php on line 78

我的代码是:

$srting= "testing email"; 
ini_set("SMTP","webmail.saj.ir"); 
ini_set("sendmail_from","[email protected]"); 
$headers= 'MIME-Version: 1.0' . "\r\n"; 
$headers.= 'Content-type: text/html; charset=utf8' . "\r\n"; 
$headers .= 'From: www.saj.ir' . "\r\n"; 
mail("[email protected]","class list",$srting,$header); 

我不知道 谢谢。

i change webmail.saj.ir to http://ns1.easysoftco.com and now i face this message : Failed to connect to mailserver at "http://ns1.easysoftco.com" port 25, verify your "SMTP" and "smtp_port"

哦,我发现我的问题:我使用的寡妇和IIS 7.5
是有办法的邮件在IIS 7.5

+1

是webmail.saj.ir您可以用作中继的SMTP服务器?这是在Windows机器上运行吗? (SMTP ini设置仅适用于Windows) – 2012-04-03 07:19:07

+0

感谢Emil,我将webmail.saj.ir更改为'http:// ns1.easysoftco.com'。 – aya 2012-04-03 07:29:22

回答

2

您已经定义$headers和你正在使用$header

$srting= "testing email"; 
ini_set("SMTP","http://ns1.easysoftco.com"); 
ini_set("sendmail_from","[email protected]"); 
$headers= 'MIME-Version: 1.0' . "\r\n"; 
$headers.= 'Content-type: text/html; charset=utf8' . "\r\n"; 
$headers .= 'From: www.saj.ir' . "\r\n"; 
mail("[email protected]","class list",$srting,$headers); 
+0

感谢salman,我将$ header改为$ headers,但仍然查看相同的错误。 – aya 2012-04-03 07:49:50

+0

再次尝试它的工作完美我跑了剧本..... – Shaun 2012-04-03 08:00:03

+0

尝试在一个单独的文件中运行它只有上面提到的代码,如果它工作正常比反向工程师您的代码 – Shaun 2012-04-03 08:04:03

相关问题