简体   繁体   English

mail():SMTP服务器响应:550 hmailserver上的地址无效错误

[英]mail(): SMTP server response: 550 The address is not valid error on hmailserver

I am getting this error despite configuring php.ini to a valid send_from address. 尽管将php.ini配置为有效的send_from地址,但仍收到此错误。 I know it is valid because it works when I send it from squirrel mail but when sending mail in php it will just not work. 我知道它是有效的,因为当我从松鼠邮件发送邮件时它可以工作,但是在php中发送邮件时它就行不通了。 the invalid address presumably refers to the send_from address. 无效地址大概是指send_from地址。 so I can't see how it can think it's wrong. 所以我看不出它怎么会认为这是错误的。 here is the php code: 这是PHP代码:

$email="tobiasvogel1@googlemail.com";
$subject = "Your New Password";
$from="admin@dayshare.local";
$message = "Your new password is as follows:

xxxxxxxxxxxxxxxxxxxxxxxxxxx

This email was automatically generated.";

      if(!mail($email, $subject,$message,$from)){
         echo ("error");
      }else echo "success";

and in php.ini: 并在php.ini中:

SMTP = localhost

sendmail_from = admin@dayshare.local

550 Delivery is not allowed to this address 550不允许送货到该地址

This error means that the sender is trying to send an email to an address which he is not allowed to send to. 此错误意味着发件人试图将电子邮件发送到不允许其发送到的地址。 This message is generated after hMailServer has checked the IP range settings. hMailServer检查IP范围设置后,将生成此消息。 As an example, the default IP range configuration does not allow external users to send messages to other external users. 例如,默认的IP范围配置不允许外部用户向其他外部用户发送消息。 This is to prevent people from using your server to send spam. 这是为了防止人们使用您的服务器发送垃圾邮件。 So if an external user tries to send a message to another external user, he will get this message. 因此,如果外部用户尝试向其他外部用户发送消息,他将收到此消息。

That is the meaning of the error you are getting. 这就是您得到的错误的含义。 This is from the hMailServer Documentation . 这来自hMailServer文档

Can you try if the following will work? 您是否可以尝试以下方法?

<?php
mail('tobiasvogel1@googlemail.com','Test Email','This is a test email.',"From: tobiasvogel1@googlemail.com");
?>

If it doesn't work, then it's probably due to a misconfiguration in your hMailServer and you would need to check your hMailServer Logs . 如果它不起作用,则可能是由于hMailServer中的配置错误,您需要检查hMailServer日志

The 4th parameter of the mail() function is not plain "from". mail()函数的第4个参数不是简单的“ from”。 In your code, you are only passing the email address without "From: " - The fourth parameter is for additional mail headers, so you have to format it like this: 在您的代码中,您仅传递不带“发件人:”的电子邮件地址-第四个参数用于附加邮件头,因此您必须像这样设置其格式:

mail($email, $subject,$message,"From: admin@dayshare.local\r\nX-Mailer: PHP");

I added another header as an example. 我添加了另一个标头作为示例。

试试这个,为我工作:

ini_set("sendmail_from", "info@yourdomain.com");

您需要引号和分号:

$email="tobiasvogel1@googlemail.com";

here is another solution - WAMP send Mail using SMTP localhost 这是另一种解决方案-WAMP使用SMTP本地主机发送邮件


KEEP IN MIND, everytime, after You change php.ini, 记住,每次更改php.ini之后,

you must restart wamp (! ! !) 您必须重新启动wamp(!!!)

ps in php.ini, i have used: php.ini中的ps,我用过:

SMTP = localhost 
smtp_port = 25 
sendmail_from = your_user@gmail.com

or if oyu cant edit php.ini, try to insert these lines in your php script. 或者如果oyu无法编辑php.ini,请尝试在您的php脚本中插入这些行。

ini_set("SMTP", "localhost");
ini_set("smtp_port", "25");
ini_set("sendmail_from", "your_user@gmail.com");

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 警告:mail()[function.mail]:SMTP服务器响应:550 - Warning: mail() [function.mail]: SMTP server response: 550 邮寄交换服务器SMTP服务器响应:550验证失败 - Mail an exchange server SMTP server response: 550-Verification failed SMTP服务器响应:550 Apache php邮件服务器 - SMTP server response: 550 apache php mail server 将邮件发送到本地邮件服务器 - “SENT:550地址无效。” - Sending mail to local mail server - “SENT: 550 The address is not valid.” 如何修复mail():SMTP服务器响应:550 5.5.0 PHP中无效的EHLO / HELO域错误 - how to fix mail(): SMTP server response: 550 5.5.0 Invalid EHLO/HELO domain error in php hmailserver 550无效地址错误通过php格式发送 - hmailserver 550 invalid address error sending via php form 警告:mail()[function.mail]:SMTP服务器响应:550无效的收件人: - Warning: mail() [function.mail]: SMTP server response: 550 Invalid recipient: 数据结束后来自远程邮件服务器的 SMTP 错误:550 使用 PHP mail() 发送垃圾邮件的概率很高? - SMTP error from remote mail server after end of data: 550 High probability of spam with PHP mail()? SMTP服务器响应:550 5.7.1无法中继 - 将电子邮件发送到非公司地址 - SMTP server response: 550 5.7.1 Unable to relay in - Sending email to a non-company address 警告:mail():SMTP 服务器响应:550 语法无效。 语法应为 MAIL FROM:&lt;mailbox@domain&gt;[crlf] - Warning: mail(): SMTP server response: 550 Invalid syntax. Syntax should be MAIL FROM:&lt;mailbox@domain&gt;[crlf]
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM