我有一個專案是使用phpmailer寄發信件,在本地端執行有正常運行,
但是放到GoDaddy上面的時候卻發生錯誤-Internal Server Error,
P.S.無法直接顯示報錯
想請教有使用GoDaddy過的各位前輩,有沒有人也有遇到相同或是類似的錯誤?
P.S.下圖是目前伺服器PHP配置的設定值
<?php
//2018/04/27 15:28補充程式碼
header("content-type:text/html; charset=utf-8");
require_once("PHPMailer/phpmailer/class.phpmailer.php");
ini_set("display_errors","1");
$mail= new PHPMailer();
$mail->IsSMTP();
$mail->SMTPAuth = true;
$mail->SMTPSecure = "ssl";
$mail->Host = "smtp.gmail.com";
$mail->Port = 465;
$mail->CharSet = "utf-8";
$mail->Username = "郵件帳號";
$mail->Password = "郵件密碼";
$mail->From = "寄件者信箱";
$mail->FromName = "寄件者姓名";
$mail->IsHTML(true);
$mail->Subject ="郵件標題";
$mail->Body = "郵件內容";
$mail->AddAddress("收件者郵件及名稱");
$mail->SMTPOptions = array(
'ssl' => array(
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true
)
);
$mail->send();
?>