Recently I moved from HostGator with cPanel to a Digital Ocean droplet.
I still want to use the email service from HostGator.
So in DigitalOcean I added an A record pointing to HostGator IP, and MX record pointing to mail.mydomain.com
I can receive and send emails normally.
When I want to send an email from a Laravel application, unless it uses the same domain of my website, the mail is not sent, for example if I wanted to send to a Gmail account.
I tried with telnet, and in the inbox I saw that gmail rejects the message because it doesn't have a "From header".
Before the migration everything worked correctly so I don't think that I need to add that header to my Laravel email.
Is there something that I am missing in DNS configuration or cPanel?
This is the code that I've been using before the migration and it was working fine, now it sends emails but only when the recipient has the same domain as HostGator, which is my-domain.com:
MAIL_DRIVER=smtp
MAIL_HOST=cloud232.hostgator.com (I tried with mail.my-domain.com and it works too)
MAIL_USERNAME=noreply@my-domain.com
MAIL_PASSWORD=password
MAIL_ENCRYPTION=ssl (I tried with tls and port=587 and it works too)
MAIL_FROM_NAME=name
MAIL_PORT=465 (I tried with tls and port=587 and it works too)
Thanks in advance.
No comments:
Post a Comment