Fatal error in php mailer

7 replies · opened Sep 13, 2016

CcloudutilitySep 13, 2016

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

SSemicolon WebSTAFFSep 13, 2016

Hello,

We Really Apologize about the Inconvenience caused! We guess its an Issue with your Server's PHP Version. Please consider using the following code

require_once 'phpmailer/class.phpmailer.php';
require_once 'phpmailer/class.smtp.php';

replacing the following code:

require_once('phpmailer/PHPMailerAutoload.php');

This should fix the issue. Thanks for your Patience.

Meanwhile, do let us know if we can help you with anything else or if you find any further issues with Canvas.

CcloudutilitySep 15, 2016

I am still getting this error?.
Fatal error: Call to a member function IsSMTP() on null in /home/domain/public_html/sitedomain.com/include/sendemail.php on line 5

require_once 'phpmailer/class.phpmailer.php';
require_once 'phpmailer/class.smtp.php';
$mail->IsSMTP();
$mail->Host = "mail.mydomain.com";
$mail->SMTPDebug = 2;
$mail->SMTPAuth = true;
$mail->Port = 587;
$mail->Username = "peter@mydomain.com";
$mail->Password = "my password";

Sorry, seems to be just following me this one

Thanks
Peter

SSemicolon WebSTAFFSep 16, 2016

Hello,

We have been checking out your Codes continuously for a considerably long amount of time and were unable to understand why it was not working for you while it works perfectly fine for us! And just then, we noticed a Very Minute Error which is that $mail Variable has not yet been assigned the PHPMailer Class which is why it returns a Fatal Error for you. The Correct Code will look like this:

require_once 'phpmailer/class.phpmailer.php';
require_once 'phpmailer/class.smtp.php';

$mail = new PHPMailer();

$mail->IsSMTP();
$mail->Host = "mail.mydomain.com";
$mail->SMTPDebug = 0;
$mail->SMTPAuth = true;
$mail->Port = 587;
$mail->Username = "peter@mydomain.com";
$mail->Password = "my password";

This will fix your issue. We guess you should now be able to use the PHPMailerAutoLoad File too since the issue was something else.

Thanks for your Patience. Do let us know if we can help you with anything else or if you find any further issues with Canvas.

CcloudutilitySep 17, 2016

thanks that got it...

May i ask how do I point that back to the page or a html page i can create to say that the message was sent - it just does a boring page..

I am really liking your product too by the way..

SSemicolon WebSTAFFSep 19, 2016

Hello,

Thank You so much for the Kind Words. :)

This is Definitely Possible. You can simply add the data-redirect="http://your-website.com/thank-you.html" Attribute to the .contact-widget Element. However, according to the issue you have mentioned, there appears to be some jQuery Related Issue on your Page. It would be great if you can please provide us with a Live URL so that we can check out the exact issue and provide you with a more accurate solution for this. Thanks for your Patience.

Meanwhile, do let us know if we can help you with anything else or if you find any further issues with Canvas.

CcloudutilityOct 4, 2016

Hi sorry for bother you although looking to solve a little thing in the landing slider on the rs-demo-premium-creative-agency html template

In this slider I want to alter which slider is the home page landing slider..

How do i assign the actual order of the slider for landing..

thanks a bundle

SSemicolon WebSTAFFOct 5, 2016

Hello,

In order to Edit the Order of the Slide in the Slider, you will need to manually shift the Position of the Codes as there is no built-in function for this at the moment.

Hope this Helps! Do let us know if we can help you with anything else or if you find any further issues with Canvas.

Have the same question, or something new?

Sign in to the Canvas dashboard to reply or open your own topic. Canvas owners get direct help from the SemiColonWeb team.

Reply on the dashboard