I have this error while trying to improve PHPMailer for sending automatic emails in my website:
Fatal error: Call to a member function authorise() on a non-object in /home/u289995868/public_html/es/php/class.user.php on line 116
The 'corrupted' code in the file is this:
function send_mail($email,$message,$subject)
{
require_once 'mailer/class.phpmailer.php';
require_once 'mailer/class.pop3.php';
$pop->authorise('mx1.hostinger.es', 110, 30, '[email protected]', 'xxxxxxxx', 1);
$mail = new PHPMailer();
$mail->SMTPDebug = 2;
$mail->isSMTP();
$mail->isHTML(false);
$mail->Host = 'mx1.hostinger.es';
$mail->From = '[email protected]';
$mail->FromName = 'Admin de barreeeiroo.ga';
$mail->Subject = $subject;
$mail->Body = $message;
$mail->addAddress($email);
if (!$mail->send()) {
echo $mail->ErrorInfo;
}
}
Corrupted line is $pop->authorise(...);
.
You can take a look to the require_once
files here: GitHub.
Thanks for the answer.