Sendmail PHP无法正常工作 - Go Daddy Hosting

I think this is straightforward, but for some reason it's not working. Does anyone see a problem with my code? If not, I'm guessing it's the hosting that's the issue.

Here's the code:

HTML

<form action="sendmail.php" name="form1" method="post">
       <input name="hidSubmit" type="hidden" value="true" id="hidSubmit" />
<input type="text" placeholder="Your Name" name="txtName" required><br>
<input type="email" placeholder="Email Address" name="txtEmail" required><br>
<input type="number" placeholder="Phone Number" name="txtPhone"><br>
<button type="submit" value="Submit" class="butt"><strong>Submit</strong></button>
    </form>

PHP

<?php

//Check whether the submission is made
if(isset($_POST["hidSubmit"])){

//msg body
$txtMsg = "Enquiry From Website
Name : ".$_POST["txtName"]."
Email: ".$_POST["txtEmail"]."
Phone: ".$_POST["txtPhone"]."
";

//Declarate the necessary variables
$mail_to = "info@insidemarketstrategy.com";
$mail_from= "admin@insidemarketstrategy.com";
$mail_sub="Inquiry from insidemarketstrategy.com Website";
$mail_mesg=$txtMsg; 
$headers = "From: admin@insidemarketstrategy.com
" .
     "X-Mailer: php" . "Content-type: text/html; charset=iso-8859-1
";


//Check for success/failure of delivery 
if(mail($mail_to,$mail_sub,$mail_mesg,$headers))
echo "<div class='alert alert-success alert-dismissable' id='alertmsg'>
 <button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>
 <h3>Thank you !<br><br><span>we will get in touch with you soon</span></h3>
</div>";
else
echo "<div class='alert alert-danger alert-dismissable'><center><span class='textred' align='center'><b>Failed to send the E-mail from $mail_sub to $mail_to</b></span></center></div>";
}

echo ("<meta http-equiv='refresh' content='5 ;url=index.html'>");
?>
doupian9798
doupian9798 你们推荐谁主持?主持鳄鱼?
6 年多之前 回复
du59131
du59131 刚刚做到了。回来了。
6 年多之前 回复
drmq16019
drmq16019 support.godaddy.com/help/article/8376/using-php-form-mailers显然有些文件已经这样做了。也许您可以使用它们,或至少窥视它们以查看您的配置是否正确。邮件仅在安装了正确的模块时才有效,并且正确的配置(SMTP服务器等)到位。
6 年多之前 回复
dongtuo4723
dongtuo4723 从有史以来最糟糕的主人搬走
6 年多之前 回复
dongnuo2879
dongnuo2879 运行phpinfo();并查看SMTP配置是什么。
6 年多之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问