Web lists-archives.com

[PHP] Re: [SOLVED] PHP cannot use a provided class




On 03/21/2018 02:54 AM, Christoph M. Becker wrote:

>> Fatal error: Class 'PHPMailer\PHPMailer' not found in
>> /home/sohne/web/php/common/php-test-email.php on line 44
> Sorry, forget that.  Actually, the class PHPMailer is contained in the
> PHPMailer\PHPMailer namespace, so you need the triple
> 
>   $mail = new \PHPMailer\PHPMailer\PHPMailer;
> 
  Bingo! Yes, that allowed the script to run.
  Thank you.

-- 
James Moe
jmm-list at sohnen-moe dot com
Think.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php