Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP mailer sentfrom error

Tags:

php

phpmailer

I am trying to send mail using PHP Mailer but there is an issue with setfrom() method

In $mail->setFrom('[email protected]', 'Jay');

When I use domain name .com mail gets sent and received properly

But when I use . co domain name example $mail->setFrom('[email protected]', 'Jay'); Its doesn't show any error and says mail sent successfully but mail isn't received on my account.Tried changing google privacy settings.

Note:Not using SMPT kept it to false using default settings

Update:Ok so the thing is It is working but the emails are being receive after hours and hours if I use .co but when I use .com email are received immediately. Probably server problem.

like image 346
Mohammed Gadiwala Avatar asked Jun 07 '26 20:06

Mohammed Gadiwala


1 Answers

This sounds like a known problem that's been answered before: gmail does not allow setting arbitrary from addresses. You can preconfigure aliases in settings, but you can't simply start using them at the sending client. You can see the submission conversation by setting $mail->SMTPDebug = 2;, but if it's sending successfully, PHPMailer has no involvement beyond that point.

like image 175
Synchro Avatar answered Jun 09 '26 11:06

Synchro



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!