簡體   English   中英

使用Go Daddy的PHP Mailer錯誤

[英]PHP Mailer error using Go Daddy

郵件請幫助。 我在Go Daddy上托管的PHP郵件程序無法正常工作。 知道為什么電子郵件無法發送嗎?

<?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");

它們是您的代碼中的錯字錯誤。

$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

注意:您未驗證用戶輸入。 請在服務器端對它們進行驗證,以避免錯誤和攻擊嘗試。

如果您有任何其他錯誤,請清楚說明。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM