gpt4 book ai didi

Windows 托管错误上的 php 联系表单

转载 作者:可可西里 更新时间:2023-11-01 10:51:00 25 4
gpt4 key购买 nike

我正在尝试在 widows asp.net 托管包上使用 php 联系表单,php 已启用但我的表单仍然没有发送电子邮件,它指向 error.html 页面......

这是代码

<?php

$EmailFrom = "anksaltlamps.com";
$EmailTo = "support@anksaltlamps.com";
$Subject = "Website Query";
$Name = "Not Specified";
$Tel= "Not Specified";
$City= "Not Specified";
$Country= "Not Specified";
$Other= "Not Specified";
$Address= "Not Specified";
$Message= "Not Specified";
$State= "Not Specified";


$Name = Trim(stripslashes($_POST['Name']));
$Tel = Trim(stripslashes($_POST['Tel']));
$Email = Trim(stripslashes($_POST['Email']));
$City = Trim(stripslashes($_POST['City']));
$State = Trim(stripslashes($_POST['State']));
$Country = Trim(stripslashes($_POST['Country']));
$Other = Trim(stripslashes($_POST['Other']));
$Address = Trim(stripslashes($_POST['Address']));
$Message = Trim(stripslashes($_POST['Message']));

// prepare email body text
$Body = "";
$Body .= "Name: ";
$Body .= $Name;
$Body .= "\n";

$Body .= "Tel: ";
$Body .= $Tel;
$Body .= "\n";

$Body .= "Email: ";
$Body .= $Email;
$Body .= "\n";

$Body .= "Address: ";
$Body .= $Address;
$Body .= "\n";

$Body .= "City: ";
$Body .= $City;
$Body .= "\n";

$Body .= "State/Province: ";
$Body .= $State;
$Body .= "\n";

$Body .= "Country: ";
$Body .= $Country;
$Body .= "\n";

$Body .= "Other Country: ";
$Body .= $Other;
$Body .= "\n";

$Body .= "Message: ";
$Body .= $Message;
$Body .= "\n";

ini_set('sendmail_from', 'support@anksaltlamps.com');
// send email
$success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");

// redirect to success page
if ($success){
print "<meta http-equiv=\"refresh\" content=\"0;URL=thanks.html\">";
}
else{
print "<meta http-equiv=\"refresh\" content=\"0;URL=error.html\">";
}
?>

或者您通过此链接在线查看

link text

最佳答案

Read this .这可能是由于您在 php.ini 中的邮件设置所致。

关于Windows 托管错误上的 php 联系表单,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3468347/

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