I have a simple Mail post script with Phpmailer Master that i downloaded from github.
i have a fatal error on my script. But i cant find the solution. I googled but i didnt find any source for this error.
My script looks like this;
<?php require_once("ayarlar.php"); ?>
<?php
if(($_POST["kullanici"]==$kullanici)and(isset($_POST))) // Authetnticating Admin E-Mail Address
{
/* Şifremi Unuttum Mail Gövdesi */
$ad="Company Name";
$mesaj ="
<style type='text/css'>
body{
font-family:'Verdana', Geneva, sans-serif;
font-size:10px;
}
table{
font-size:14px;
}
</style>
<h2>ADMIN PASSWORD</h2>
<hr>
<table style='width: 100%;'>
<tr style='width: 100%;'>
<td valign='middle' style='height:30px;width:50%;'>KULLANICI ADI: $kullanici</td>
</tr>
<tr style='width: 100%;'>
<td valign='middle' style='height:30px;width:50%;'>ŞİFRE: $parola</td>
</tr>
<tr style='width: 100%;'>
<td valign='middle' style='height:30px;width:50%;'>Lütfen Bu Epostayı Güvenli Bir Yerde Saklayın ve/veya Yazdırın</td>
</tr>
</table>";
/* Şifremi Unuttum Mail Gövdesi */
/* Php Mailer Class Mail Göndermek İçin */
require_once("../inc/phpmailer/class.phpmailer.php");
$mail = new PHPMailer();
$mail->CharSet = "UTF-8";
$mail->AddAddress ("[email protected]","Company Name");
$mail->Subject = "ADMIN PASSWORD";
$mail->Body = "$mesaj";
$mail->Port = 26;
$mail->IsSMTP();
$mail->Host = "mail.example.com";
$mail->SMTPAuth = true;
$mail->Username = "[email protected]";
$mail->Password = "password";
$mail->IsHTML(true);
$mail->From = $kullanici;
$mail->FromName = $ad;
$mail->Send();
/* Php Mailer Class Mail Göndermek İçin */
echo "<script>
alert('Şifreniz Başarılı Bir Şekilde Eposta Adresinize Ulaştırılmıştır');
window.location.href='http://www.example.com/admin-password';
</script>";
}
else
{
echo "<script>
alert('Hatalı Eposta Adresi');
window.location.href='javascript:history.back()';
</script>";
exit();
}
?>
And i got following error:
Fatal error: Call to undefined method PHPMailer::IsSMTP() in /path/ on line 39
39 Line: $mail->IsSMTP();
Any suggestions? Thanks For Helps.
I have found the solution. Update my phpmailer library.