php - 无法使用php邮件功能发送邮件

标签 php email smtp

我试图在我的本地计算机上使用 PHP 邮件,但它就是不工作。我正在使用来自 php 网站的标准脚本:

我遇到的 PHP 错误

SMTP server response: 550 Error sending message: Error: FROM address is invalid

实际的PHP

$to      = 'nobody@example.com';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: webmaster@example.com' . "\r\n" .
    'Reply-To: webmaster@example.com' . "\r\n" .
    'X-Mailer: PHP/' . phpversion();

mail($to, $subject, $message, $headers);

我下载了一个本地邮件服务器,argosoft。它说服务 URL 是 http://services.argosoft.com/RelayService/Service.asmx .我假设这是我放入 php.ini 的内容。

php 初始化程序。

 For Win32 only.
 SMTP = services.argosoft.com/RelayService/Service.asmx
 smtp_port = 25

最佳答案

我以前遇到过这个错误,我相信你所要做的就是将电子邮件 webmaster@example.com 更改为真实的电子邮件。确保您也将它发送到真实的电子邮件。

关于php - 无法使用php邮件功能发送邮件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6210156/

相关文章:

php - Laravel Echo Server 给出错误未处理的错误事件 : Error: connect ECONNREFUSED

javascript - 单击 html 按钮发送电子邮件

php - 尝试使用 SwiftMailer : Connection could not be established with host smtp. gmail.com [#0] 通过 Symfony 2 发送电子邮件

email - 在 Laravel 中自定义密码重置邮件 View

php - SMTP 错误 : Could not connect to SMTP host. 邮件程序错误:SMTP 错误:无法连接到 SMTP 主机

ruby-on-rails - 使用 SMTP 通过 gmail 使用 ruby​​ on rails 通过 sendgrid 发送电子邮件

php - mysql:如果在30天内找到表中最近的日期并回显列名在哪里找到结果?

c# - 如何使用 WCF 使用 PHP SOAP 服务

php - 在多个表中选择一个不同的值(sql)

php - 使用 PHPMailer 发送电子邮件