php - PHP 联系表单提交错误
问题描述
在此表单提交中,我遇到了一些错误。
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');
?>
解决方案
推荐阅读
- excel - 使用 office.js 或加载项清单功能关闭打开的桌面任务窗格
- anychart - 如何在不重新渲染图表的情况下删除技术指标?
- c# - 比较复杂对象并获得差异 C# .NET Core 3.1
- amazon-web-services - S3 select - 如何通过非标准时间戳比较查询
- python - 从.config文件中获取路径时出现Python Panda Dataframe错误
- python - 如何按值拆分csv数据
- c++ - DirectX 11 枚举 D3D11_USAGE 和 D3D_PRIMITIVE_TOPOLOGY 警告
- c++ - 如何在不节省外部价值的情况下迈入10分?
- mongodb - mongodb 使用 $reduce 将值推送到数组中
- docker - 向 docker 容器添加健康检查