警告:错误消息返回路径(PHP) [英] Warning: Bad Message Return Path (PHP)

查看:193
本文介绍了警告:错误消息返回路径(PHP)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是php的新手,我想建立一个简单的联系表单脚本。我一直收到此消息:

I'm new to php and I'm tying to set up a simple contact form script. I keep getting this message:


警告:mail():
中的错误消息返回路径C:\xampp\第16行上的htdocs\php_101\action.php

Warning: mail(): Bad Message Return Path in C:\xampp\htdocs\php_101\action.php on line 16

这是我的php代码。谢谢:

Here's my php code. Thanks:

ini_set('SMTP','smtpout.secureserver.net');
ini_set('smtp_port',80);
$name = $_POST['name'];
$to = "bgreen@oblivy.com";
$from = $_POST['email'];
$subject = $_POST['subject'];
$message = $_POST['message'];
echo $subject, " from ", $name, " at ", $from, "<br/>";
echo $message;
$retval = mail( $to, $subject, $message );


推荐答案

根据您的评论,您尝试使用通过Gmail服务器将邮件传递到 oblivy.com 。除非您是已注册并经过身份验证的用户,否则Google绝对不会允许这样做。接受来自匿名方的任何目的地的消息的服务器称为开放中继

As per your comments, you're trying to use Gmail server to deliver messages to oblivy.com. Google will never allow that unless you're a registered and authenticated user. Servers that accept messages from anonymous parties for any destination are called open relays:


开放式中继(有时称为不安全中继或第三方
中继)是SMTP电子邮件服务器,它允许第三方
电子邮件的聚会中继。通过处理既不是发给本地用户又不是来自
本地用户的邮件,开放中继可以使不道德的发件人
路由大量垃圾邮件。实际上,服务器的所有者(通常不知道问题的
)将网络和
的计算机资源捐赠给发件人。除了垃圾邮件发送者劫持服务器时产生的
财务成本外,
的组织还可能遭受系统崩溃,设备损坏以及
的业务损失。

An open relay (sometimes called an insecure relay or a third-party relay) is an SMTP e-mail server that allows third-party relay of e-mail messages. By processing mail that is neither for nor from a local user, an open relay makes it possible for an unscrupulous sender to route large volumes of spam. In effect, the owner of the server -- who is typically unaware of the problem -- donates network and computer resources to the sender's purpose. In addition to the financial costs incurred when a spammer hijacks a server, an organization may also suffer system crashes, equipment damage, and loss of business.

它们在1990年代后期成为问题,并且创建了开放中继的黑名单,因此邮件服务器管理员可以拒绝来自此类服务器的任何传入邮件。

They became a problem in the late 1990s and blacks lists of open relays were created, so mail server administrators could just reject any incoming mail from such servers.

因此,您需要创建一个Gmail帐户并在发送邮件时提供其凭据。此外,如果启用了双重身份验证,则还需要在此处使用专用的应用程序密钥(而不是常规密码)。

Thus you need to create a Gmail account and provide its credentials when sending mail. Additionally, if you enable two-factor authentication you also need a dedicated application key to use here (instead of your regular password).

并通过身份验证发送电子邮件支持SMTP-AUTH(以及可能的加密)的完整邮件库。旧的 mail()没有。

And to send email with authentication you need a full-fledged mail library that supports SMTP-AUTH (and possibly encryption). Good old mail() doesn't.

这篇关于警告:错误消息返回路径(PHP)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆