无法使用php邮件功能发送邮件
我尝试在本地计算机上使用 PHP 邮件,但它不起作用。我正在使用 php 网站上的标准脚本:
PHP 错误 我得到了
SMTP server response: 550 Error sending message: Error: FROM address is invalid
实际的 PHP
$to = '[email protected]';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: [email protected]' . "\r\n" .
'Reply-To: [email protected]' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);
我下载了本地邮件服务器 argosoft。它说服务 URL 是 http://services.argosoft.com/RelayService/Service.asmx。我认为这就是我放入 php.ini 中的内容。
PHP.ini.php
For Win32 only.
SMTP = services.argosoft.com/RelayService/Service.asmx
smtp_port = 25
Im trying to use PHP mail on my local computer, but its just not working. I am using the standard script from the php website:
PHP error I'm getting
SMTP server response: 550 Error sending message: Error: FROM address is invalid
actual PHP
$to = '[email protected]';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: [email protected]' . "\r\n" .
'Reply-To: [email protected]' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);
i downloaded a local mail server, argosoft. it says the service URL is http://services.argosoft.com/RelayService/Service.asmx . I assume this is what i put in php.ini.
php ini.
For Win32 only.
SMTP = services.argosoft.com/RelayService/Service.asmx
smtp_port = 25
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我以前遇到过这个错误,我相信您所要做的就是更改电子邮件
[email protected]
到真实的电子邮件。确保您也将其发送到真实的电子邮件。I have had this error before, and I believe all you have to do is change the email
[email protected]
to a real email. Make sure you send it to a real email as well.将 @example.com 替换为真实的电子邮件地址。
并在 PHP.ini 中设置
Replace @example.com with real email addresses.
and in PHP.ini set
显然,许多邮件系统在回车
\r
方面存在问题。您可能需要修改$header
以仅使用换行符\n
。看看是否有效。另外,您可能想尝试使用完整的 From 标头:
From: Some Name Here [电子邮件受保护]>
Apparently, a number of mail systems have trouble with the carriage return
\r
. You might want to modify your$header
to use only the new line character\n
. See if that works.Also, you might want to try using the full From header:
From: Some Name Here <[email protected]>