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

2022-01-17 00:00:00 smtp php hmail-server

尽管将 php.ini 配置为有效的 send_from 地址,我仍然收到此错误.我知道它是有效的,因为当我从 squirrel 邮件发送它时它可以工作,但是当用 php 发送邮件时它就不起作用了.无效地址大概是指 send_from 地址.所以我看不出它怎么会认为这是错误的.这是php代码:

I am getting this error despite configuring php.ini to a valid send_from address. 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. the invalid address presumably refers to the send_from address. so I can't see how it can think it's wrong. here is the php code:

$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";

在 php.ini 中:

and in php.ini:

SMTP = localhost

sendmail_from = admin@dayshare.local

推荐答案

550 不允许送货到此地址

此错误表示发件人正在尝试将电子邮件发送到不允许他发送到的地址.生成此消息在 hMailServer 检查 IP 范围设置后.举个例子,默认 IP 范围配置不允许外部用户向其他外部用户发送消息.这是为了防止人们使用您的服务器发送垃圾邮件.因此,如果外部用户尝试发送消息给另一个外部用户,他会收到这条消息.

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. As an example, the default IP range configuration does not allow external users to send messages to other external users. 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.

这就是您遇到的错误的含义.这来自 hMailServer 文档.

That is the meaning of the error you are getting. This is from the hMailServer Documentation.

你可以试试下面的方法是否可行?

Can you try if the following will work?

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

如果它不起作用,则可能是由于您的 hMailServer 配置错误,您需要检查您的 hMailServer 日志.

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.

相关文章