I read the topic above and I'd like to reply for a similar problem, but the post was too old and I decided to open another thread
I'm using PHPMailer 6.* in a generic PHP app (not Laravel), so I loaded it via composer.
With the following very basic code the mail catcher works (the mail is created and I can read it) but the error message Mailer Error: Could not instantiate mail function. is still printed out:
I use my real Gmail address instead of email@example.com
I did not try in production environment, only locally with Laragon
The Mail Analyzer (Menu > Preference > Mail Sender > Test Sending Email) is successfully setup - but it shouldn't be an issue since I'm relying on simple PHP mail() function, right? But, strangely, the error.log file says Authentication Required. Learn more at<EOL> https://support.google.com/mail/?p=WantAuthError v10-v6sm22495927wrm.18 - gsmtp<EOL>
While I write, though, I tested also a simple mail() (so no PHPMailer bloat):$headers = 'From: firstname.lastname@example.org'; mail('email@example.com', 'TEST', 'This is a test', $headers);
Still, the mail catcher works (the mail is created, this time in a text format obviously) but the error.log shows the same message: Authentication Required. Learn more at<EOL> https://support.google.com/mail/?p=WantAuthError l15-v6sm12355859wrt.67 - gsmtp<EOL>; this seems very strange because mail() shouldn't require any authentication...
Please, any clue? Can we use the native PHP mail() function or is it forbidden for some strange reason (maybe is it an issue on PHP 7.* ?)