Class not found in my website files

Hello, I want to send emails from my site but I don’t know why I get an error indicating that my class is not found in my PHPMailer file. Here is the error I get: Fatal error: Uncaught Error: Class ‘PHPMailer’ not found in /home/vol10_8/infinityfree.com/if0_34839555/newlist.free.nf/htdocs/testmail.php:12 Stack trace: # 0 {main} thrown in /home/vol10_8/infinityfree.com/if0_34839555/newlist.free.nf/htdocs/testmail.php on line 12 and my website: https://newlist.free.nf

Thanks in advance
Sincerely

Do you have the necessary PHPMailer files? Keep in mind that you cannot just “oh I want to use PHPMailer so I just new PHPMailer”. It is not a built-in function.

7 Likes

@superdiamant07 if you don’t know, InfinityFree also has its official version


Download here

instructions/readme is here

8 Likes

Yes, i have all phpmailer files

If you’re using Composer, did you make sure to require __DIR__."/vendor/autoload.php"; ?

7 Likes

It is also ok to just use require "vendor/autoload.php"; if the vendor folder is inthe same folder as your main index.php.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.