gpt4 book ai didi

php电子邮件脚本不发送电子邮件

转载 作者:行者123 更新时间:2023-12-03 23:09:18 24 4
gpt4 key购买 nike

我有一个脚本,用于从网站上的表单发送电子邮件。我知道代码没问题——我之前曾在两家不同的托管公司进行过测试。这次我在实际的服务器上使用它,而不是在托管公司。基本上,用户填写表格,单击提交并获得消息已发送的确认页面。唯一的问题是没有电子邮件。这是脚本:

 $nickname = $_REQUEST['nickname'] ;
$email = $_REQUEST['email'] ;
$tel = $_REQUEST['tel'] ;
$comp = $_REQUEST['comp'] ;
$message = $_REQUEST['message'] ;


// Let's check if all fields are filled in!
if(empty($nickname) || empty($email) || empty($comp))
{
$error = "All of the required fields have not been completed, <a href=\"javascript:history.go(-1)\">please click here to go back.</a>";
}
else
{
$content= "$nickname has sent you an e-mail from XXX
Query:
$message
You can contact $nickname via Email: $email. <br />Other relevant details of individual: <br />Telephone Number: $tel <br />Company: $comp";

mail( "user@gmail.com", "Query", $content, "From: $email"); //first thing has to be address it is going to, then what the subject of the mail should be, the content and a from address which will be the query submitter.
echo "<h2>$nickname</h2><br></br>
Your query has been succesfully sent. <br></br><br></br>
We will deal with this query and be in touch as soon as possible.<br></br><br></br><br></br>
The contact details you submitted are: <br></br><br></br>
<strong>Email:</strong>&nbsp; $email<br></br><br></br>
<strong>Phone:</strong>&nbsp; $tel<br></br><br></br>
<strong>Company:</strong>&nbsp; $comp<br></br><br></br>
<a //href=\"javascript:history.go(-1)\"> Click here to return to the contact page.</a></br>";
};

?>

我也不知道这是否重要,但直到最近,PHP 还无法在服务器上运行,并给出 HTTP 错误 405 错误,说明该动词不被允许。此问题已得到解决。

最佳答案

恭喜。您已经创建了一个开放的 SPAM 服务,允许每个人发送群发邮件。

检查一下:

http://www.securephpwiki.com/index.php/Email_Injection#php_mail.28.29_function

:-)

关于php电子邮件脚本不发送电子邮件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3726775/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com