我的表格不会在网站上提交。它只显示mail.php上的空白页面
我做错了什么。有一个html表单,它接受三个输入:姓名、备注和电话。表单上的操作是mail.php,方法是POST 下面是mail.php中的代码。成功后,我希望它返回主页我的表格不会在网站上提交。它只显示mail.php上的空白页面,php,linux,web,nginx,phpmailer,Php,Linux,Web,Nginx,Phpmailer,我做错了什么。有一个html表单,它接受三个输入:姓名、备注和电话。表单上的操作是mail.php,方法是POST 下面是mail.php中的代码。成功后,我希望它返回主页 <?php // multiple recipients //$to = 'waleed.dogar@gmail.com' . ', '; // note the comma error_reporting(E_STRICT); date_default_timezone_set('America/Toronto
<?php
// multiple recipients
//$to = 'waleed.dogar@gmail.com' . ', '; // note the comma
error_reporting(E_STRICT);
date_default_timezone_set('America/Toronto');
require_once('/phpmailer/class.phpmailer.php');
require_once('/phpmailer/class.smtp.php');
$mail = new PHPMailer();
$mail->Subject = 'Form Submission on Website';
$name = $_REQUEST['name'] ;
$notes = $_REQUEST['notes'] ;
$phone = $_REQUEST['phone'] ;
$body = "You have received a new message from $name.\n". "Here is the phone number:\n $phone". "Here are the additional notes: \n $notes";
$mail->IsSMTP(); // telling the class to use SMTP
$mail->Host = "smtpout.secureserver.net"; // SMTP server
$mail->SMTPDebug = 2; // enables SMTP debug information (for testing)
// 1 = errors and messages
// 2 = messages only
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->Host = "smtpout.secureserver.net"; // sets the SMTP server
$mail->Port = 80; // set the SMTP port for the GMAIL server
$mail->Username = "alex@acemobiledetailing.ca"; // SMTP account username
$mail->Password = "password"; // SMTP account password
$mail->SetFrom('example@example.ca', 'Alex Website');
$mail->AddReplyTo("example@example.ca","Alex ");
$mail->MsgHTML($body);
$address = "example@gmail.com";
$mail->AddAddress($address, $name);
$mail-> Send();
if(!$mail->Send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
} else {
echo "Message sent!";
GOTO(http://example.com/thankyou.php);
}
?>
你看过php错误日志了吗?后藤http://example.com/thankyou.php; 不起作用,我认为你应该使用头部定位:http://example.com/thankyou.php.Try 添加ini设置“显示错误”,1;在脚本的开头,或者检查虚拟主机配置中是否有诸如ErrorLog之类的条目。如果您使用apache和linux,它们可能在/var/log/apachei中。我检查了我的错误日志,邮件上出现错误500 5。php您的包含路径对于phpMailer是错误的。PHP没有看到这些文件。为它们设置正确的路径。阅读这里:所以我修复了include路径,它仍然显示一个空白页,什么也没有发生。错误500应该是什么意思?我正在linux服务器上运行nginx