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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With