简体   繁体   English

使用Go Daddy的PHP Mailer错误

[英]PHP Mailer error using Go Daddy

mailPlease help. 邮件请帮助。 My PHP mailer is not working that I host on Go Daddy. 我在Go Daddy上托管的PHP邮件程序无法正常工作。 Any idea why the email won't send? 知道为什么电子邮件无法发送吗?

<?php
session_start();

$contact=$_POST['contact'];
$phone=$_POST['telephone'];
$email=$_POST['email'];
$msg=$_POST['message'];

$to="webform@xxx.com";
$subject="Contact Form";
$from=$email;
$message .= '<table border="1px" width="50%" style="border:1px black solid;margin:0px auto">';
$message .= '<tr><th colspan="2" style="text-align:center">Contacts Information</th></tr>';
$message .= '<tr><td>Name :- </td><td>'.$contact.'</td></tr>';
$message .='<tr> <td>Phone No. :- </td><td>'.$phone.'</td></tr>';
$message .= "<tr><td>Email :- </td><td>" . $email . "</td></tr>";
$message .= "<tr><td>Message :- </td><td>" . $msg. "</td></tr>";
$message .= "</table>";

$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";
$headers .= 'From: ' . $from . "\r\n";

mail($to, $subject, $message, $headers);

header("Location: sent.html");

Their is a typo error in your code. 它们是您的代码中的错字错误。

$contact=$_POST['contact'];
$phone=$_POST['telephone'];
$email=$_POST['email']; 
$msg=$_POST['message'];

$to="webform@xxx.com";
 $subject="Contact Form";
$from=$enm; //this should be $from=$email

CAUTION: ur not validating user input. 注意:您未验证用户输入。 Pls do validate them server side to avoid errors and attack attempts. 请在服务器端对它们进行验证,以避免错误和攻击尝试。

If u have any other error pls state it clearly. 如果您有任何其他错误,请清楚说明。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM