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

问题描述

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

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

这是我的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:

它们在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)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-24 18:48
查看更多