【发布时间】:2022-01-18 19:25:10
【问题描述】:
我正在尝试确定为什么我们没有收到来自我们网站表单的邮件。
我们托管公司的所有权发生了变化,表格停止工作,新管理层似乎一无所知。
我可以看到的文件中没有错误日志,也没有 php.ini 文件。这是phpinfo:http://www.fryermachine.com/phpinfo.php.
这是 mail() 代码...
<?php
error_reporting(-1);
ini_set('display_errors', 'On');
set_error_handler("var_dump");
if ($_POST['submit']) {
$to = 'service@fryermachine.com';
//$to = 'brinster@digitmedia.com';
$subject = 'Support email from FryerMachine.com';
$message = "FIRST NAME: " . $_POST['First_Name'] . "\r\n" . "LAST NAME: " . $_POST['Last_Name'] . "\r\n" . "COMPANY: " . $_POST['Company'] . "\r\n" . "PHONE: " . $_POST['Phone'] . "\r\n" . "EMAIL: " . $_POST['Email'] . "\r\n" . "MODEL: " . $_POST['Model'] . "\r\n" . "SN: " . $_POST['SN'] . "\r\n" . "CONTROL: " . $_POST['Control'] . "\r\n" ."MESSAGE: " . $_POST['Message'] . "\r\n";
$headers = 'From: service@fryermachine.com';
if (!mail($to,$subject,$message,$headers)) {
echo "<p>There was a problem submitting your form. Please <a href=\"mailto:info@fryermachine.com\">contact us</a>.</p>";
} else {
echo "<div class=\"thanks\"><p>Thank you for your inquiry. We will respond as soon as possible.</p></div>";
} ?>
使用这个...
error_reporting(-1);
ini_set('display_errors', 'On');
set_error_handler("var_dump");
我得到这个输出。虽然我看到了表单的所有变量,但我没有看到任何错误。
Copyright © int(2) string(386) "date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone." string(42) "/virtual/home/fryer/public_html/footer.php" int(7) array(8) { ["_GET"]=> array(0) { } ["_POST"]=> array(11) { ["First_Name"]=> string(5) "Barry" ["Last_Name"]=> string(8) "Brinster" ["Company"]=> string(10) "Digitmedia" ["Phone"]=> string(10) "6093674793" ["Email"]=> string(23) "brinster@digitmedia.com" ["Model"]=> string(7) "3242342" ["SN"]=> string(5) "23232" ["Control"]=> string(4) "3232" ["Message"]=> string(4) "test" ["g-recaptcha-response"]=> string(484) "03AGdBq26aa_IGjWkjBx6AD-3vknIRZd953gdoDBunlELaN_OHWODA7SkGVHoqIlHUHFKnAvxUJMnLS0m4rHo0uiCWoCeo2f_IFF_Oe99OLEEMbLJqpPqfm6Fo2JQQOIP7M41LucLyMBiGgelN9Mk8hz8JP2ZUNOOzRcw5bjwh-0deSUm6jEbELYM29hAuO_G9h0rpoeA51cB4GF6hgVCsXmf2DUB_7Jz2W4Ir3RcBqtu2kBPlszfc9vODzRAgyE9p2t_Iaw4GjTQ6gTn5xEl4nDj7fYJNGKlpcK9s6472jbqeO_fHPxoufHWFk82yJqzzYfHYnBo5zgS1AZcgYuBPfLgoRhqtOS4U2XpxxYLp0_UPFMQEt73N3FbMACh6IqywJTCP7NVWBw7VGhpFBVhe6yXeYG8XTEMPCkXAIsf4yhKvIbOV0-aAld5_qWXEoFScm3H8fr1f1U61uAa48UYXVcIKIcaHvtJ0qA" ["submit"]=> string(6) "Submit" } ["_COOKIE"]=> array(3) { ["_ga"]=> string(27) "GA1.2.1114367905.1611002481" ["_gid"]=> string(27) "GA1.2.2097634062.1639520206" ["_gat_gtag_UA_80412166_1"]=> string(1) "1" } ["_FILES"]=> array(0) { } ["to"]=> string(24) "service@fryermachine.com" ["subject"]=> string(35) "Support email from FryerMachine.com" ["message"]=> string(169) "FIRST NAME: Barry LAST NAME: Brinster COMPANY: Digitmedia PHONE: 6093674793 EMAIL: brinster@digitmedia.com MODEL: 3242342 SN: 23232 CONTROL: 3232 MESSAGE: test " ["headers"]=> string(30) "From: service@fryermachine.com" } 2021 Fryer Machine Systems, Inc.
【问题讨论】:
-
在PHP mail function doesn't complete sending of e-mail的主要答案中涵盖了您需要了解和调查此类事情的所有信息
-
电子邮件的 tl;dr 是不发送和不接收之间的主要区别。