Phpmailer smtp 500错误托管错误

时间:2014-10-23 22:02:40

标签: smtp phpmailer

我试图使用phpmailer。起初我的脚本工作但现在我执行此脚本时出现内部服务器错误500。我究竟做错了什么? 这是我的剧本:

 require('class.phpmailer.php');
        require("class.smtp.php");
        $mail           = new PHPMailer();
        $mail->IsSMTP(); 
        $mail->Host       = 'mx1.hostinger.nl'; 
        $mail->SMTPDebug  = true; 
        $mail->SMTPAuth   = true;     
        $mail->Host       = 'mx1.hostinger.nl'; 
        $mail->Port       = 2525;
        $mail->Username   = 'EMAIL'; 
        $mail->Password   = 'PASSWORD';
        $mail->SetFrom('EMAIL', 'NAME'); 
        $mail->AddReplyTo('EMAIL','NAME'); 
        $mail->AddAddress($email);
        $mail->Subject    = 'Kortingsbon aanmelding NAME nieuwsbrief';

        $mail->AltBody    = 'To view the message, please use an HTML compatible email viewer!'; 
        $mail->IsHTML(true);
        $mail->Body = '<table width="100%"; rules="all" style="border:1px solid #3A5896;" cellpadding="10"><tr><td><img src="LOGOLOCATION/logo.png" alt="ALTTEKST" /></td></tr><tr><td colspan=2>Beste Klant,<br /><br />Bedankt voor uw aanmelding voor onze nieuwsbrief met e-mailadres <strong>'.$email.'</strong>. <br />Hieronder vindt u de kortingsbon. Print deze kortingbon uit zodat u gebruik kunt maken van deze actie bij uw volgende aankoop. Wij hopen u binnenkort weer te begroeten in onze winkel!</td></tr><tr><td colspan=2><i>Wordt uw kortingsbon hieronder niet weegegeven? Klik dan op inhoud toestaan, vertrouw afzender of afbeeldingen weergeven bij uw e-mailprogramma.</i> <br /> <img height="488" width="650" src="PICTURRE/'.$maand.'.JPG" alt="kortingscode foto" /></td></tr><tr><td colspan=2>Dit is een automatische e-mail en u kunt er daarom niet op reageren. 
        <p style="font-size: 10px">U kunt zich altijd weer <a href="WEBSITE">uitschrijven</a></p></td></tr></table>';
        $mail->Send();
if (!$mail->send()) {
$mail->ErrorInfo;
}

2 个答案:

答案 0 :(得分:0)

此:

$mail->ErrorInfo;

这是一个简单的语法错误 - 您不能只键入属性名称并希望它能做某事。将其更改为:

echo $mail->ErrorInfo;

当你在那里时,请更新到最新的PHPMailer。

答案 1 :(得分:0)

我在hostinger上遇到了同样的问题(错误500)。我可能错了,但似乎他们已经阻止了端口2525和25.这对我来说非常好。我希望这会对你有所帮助。

module.run(function($rootScope){
	document.addEventListener("backbutton", function (e) {
		e.preventDefault();
	}, false);
});