I have this error in my hostfinger domain:
Fatal error: Call to undefined method stdClass::Send() in /home/u111308831/public_html/index.php on line 26
This is my code:
<?php
//require_once('class.phpmailer.php');
require("PHPMailerAutoload.php");
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->CharSet = "UTF-8";
$mail->SMTPSecure = 'ssl';
$mail->SMTPAuth = true;
$mail->Host = 'smtp.gmail.com';
$mail->Port = 587;
$mail->From = 'sender@gmail.com';
$mail->FromName = 'Sender name';
$mail->AddReplyTo('sender@gmail.com', 'sender name');
$mail->IsHTML(true);
$mail->Subject = "Respuestas de Pepito";
$mail->AltBody = "To view the message, please use an HTML compatible email viewer!";
$mail->Body = "Hello";
$mail->AddAddress('receiver@gmail.com', 'receiver');
$mail->Password = 'sender pass';
$mail->Username = 'sender@gmail.com';
if(!$mail->Send()) {
echo "Error al enviar: " . $mail->ErrorInfo;
} else {
echo "Mensaje enviado!";
}
This is my line 26: if(!$mail->Send()) {
Do anyone knows what the problem could be? Thanks.