Fatal error: Call to a member function IsSMTP() on null in /home/XXXXX/XXXXX/XXXXX.com/include/sendemail.php on line 4
Hi, I am new to using this php mailer and i am getting the fatal error.. been through a few online blogs and really not getting any result..
Code is
require_once('phpmailer/PHPMailerAutoload.php');
$mail->IsSMTP();
$mail->Host = "mail.domain.com";
$mail->SMTPDebug = 2;
$mail->SMTPAuth = true;
$mail->Port = 587;
$mail->Username = "name@domain.com";
$mail->Password = "password";
also have pointed the phpmailerautoload.php file to the version of php
if (version_compare(PHP_VERSION, '5.6.21', '>=')) {
//SPL autoloading was introduced in PHP 5.1.2
if (version_compare(PHP_VERSION, '5.6.21', '>=')) {
spl_autoload_register('PHPMailerAutoload', true, true);
} else {
spl_autoload_register('PHPMailerAutoload');
greatly appreciate how to avoid this error
Thanks
