私はフォーラムを検索してしばらくこれに取り組んできましたが、コードの問題を見つけることができないようです。
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.';
}
?>