我已经为此工作了一段时间,搜索论坛,我似乎无法找到我的代码的问题。
我有一个请求信息表单,其中包含我试图通过 PHP Mailer 处理的几个字段。当我点击提交时,它会将我引导到我的 process.php 页面,该页面在浏览器中显示为空白。我收到此错误 HTTP/1.1 500 Internal Server Error 并且无权访问我的服务器日志以在那里进行故障排除。如果有人可以提供帮助,我将不胜感激。谢谢!
<?php
require_once("class.phpmailer.php");
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->From = "webmail@averybiomedical.com"; //Sender address
$mail->FromName = "Information Request "; //The name that you'll see as Sender
$mail->Host = "remote.averybiomedical.com"; //Your SMTP mail server
$mail->Port = '587';
$mail->Mailer = "smtp"; //Protocol to use
$mail->AddAddress("info@averybiomedical.com"); //The address you are sending mail to
$mail->Subject = "Mail Subject"; //Subject of the mail
$mail->Body = $_POST["title"] . " " .
$_POST["firstName"] . " " .
$_POST["lastName"] . " " .
$_POST["degree"] . "\n" .
$_POST["address1"] . "\n" .
$_POST["address2"] . "\n" .
$_POST["address3"] . " " .
$_POST["city"] . " " .
$_POST["state"] . " " .
$_POST["zipCode"] . " " .
$_POST["country"] . "\n" .
$_POST["email"] . " " .
$_POST["email2"] . "\n" .
$_POST["phone1"] . " " .
$_POST["phone1_location"] . " " .
$_POST["phone2"] . " " .
$_POST['phone2_location'] . " " .
$_POST["phone3"] . "\n" .
$_POST["relation"] . " " .
$_POST["relation_specif"] . "\n" .
$_POST["physician_specialty"] . "\n" .
$_POST["surgeon_specialty"] . "\n" .
$_POST["prof_specify"] . "\n>" .
$_POST["other_specify"] . "\n" .
$_POST['diagnosis']. "\n" .
$_POST['Insurance']. "\n" .
$_POST["funding"] . "\n" .
$_POST["source"] . "\n" .
$_POST["comments"] ; //Body of the message
$mail->SMTPAuth = "true";
$mail->Username = "myemail@averybiomedical.com"; //valid email id of the domain
$mail->Password = "mypassword"; //password for abc@xyz
if(!$mail->Send()) {
echo 'Message was not sent.';
echo 'Mailer error: ' . $mail->ErrorInfo;
} else {
echo 'Message has been sent.';
}
?>