Phpmailer shows SMTP error

Asked

Viewed 854 times

2

I am running phpmailer codes and the following error warning appears:

Fatal error: Class 'SMTP' not found in public_html/php/phpmailer/class.phpmailer.php on line 1291

Can someone help me?

inserir a descrição da imagem aqui

  • The archive class.smtp.php is in the same folder as the PHPMailerAutoload.php ?

  • Yes, it is! I got it from phpmailer’s website github. ?

  • Click on editar of your question, there is a button with image icon!

  • Look at the picture, it’s all together.

  • You have checked that it is equal to https://github.com/PHPMailer/PHPMailer/blob/master/examples/mail.phps ?

  • No! I got the code, but I didn’t know it has to be the same as this code. .

  • Now I left the code with the link you sent and that message sounded. Warning: file_get_contents(Contents.html) [Function.file-get-Contents]: failed to open stream: No such file or directory in /home/petsm976/public_html/php/partners.php on line 383

  • So this is just an example, there are many things you will not need with this line that is causing your error $mail->msgHTML(file_get_contents('contents.html'), dirname(__FILE__));

  • And how I put content, text in the email, because now this appears: Mailer Error: Message body Empty

  • 1

    Instead of $mail->msgHTML(file_get_contents('contents.html'), dirname(__FILE__)); the correct would be $mail->msgHTML("Meu código <strong> em negrito</strong>");

  • I got it, I changed it like you said. But and because I can’t use the other code, because it gives this SMTP problem?

  • I think it’s the location of the folders...?

  • @Felipedouradinho, I managed to make it work, but only now that I have uploaded my application to a server. Running local, no way. Value all the same.

  • Whoa, imagine a haha

Show 9 more comments

2 answers

1

The path is wrong, look for the wrong line, and erase the beginning that should be phpmailer/class.phpmailer.php, leaves only class.phpmailer.php.

-1

Hello,

The SMTP function is not found in the patch of your php file:

public_html/php/phpmailer/class.phpmailer.php

I recommend analyzing line 1291 in the above file for more details about the code and possibly resolve the error, make sure your phpmailer is properly compiled.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.