PHP联系表格提交错误

时间:2018-07-14 17:03:42

标签: php html

在提交此表单时,我遇到了一些错误。

1. The mail is working. But Contact form submit details not showing.
2. Its working on only gmail. Like : abc@gmail.com
3. Not working on the domain like lucky@abc.com. The mail not working. 

请提出任何建议。

<?php

       $Name = trim(strip_tags($_POST['Name']));
       $Email = trim(strip_tags($_POST['Email']));
       $Phone = trim(strip_tags($_POST['Phone']));
       $Subject = trim(strip_tags($_POST['Subject']));
       $Message = htmlentities($_POST['Message']);

       // set here
       $subject = "Contact form submitted!";
       $to = 'lachchanderdagar@gmail.com';

       $body = <<<HTML
$message
HTML;

       $headers = "From: $email\r\n";
       $headers .= "Content-type: text/html\r\n";

       // send the email
       mail($to, $subject, $body, $headers);

       // redirect afterwords, if needed
       header('Location: thanksforcontact.php');
?>

0 个答案:

没有答案