I have Laravel application having SMTP configuration setup. I was using Microsoft 365 for it but it got same fail. Then switched to sendGrid but it also got fail. This is the error I am getting: Expected response code “250” but got code “550”, with message “550 5.7.1 Sending from domain o1.eu is not allowed”.
Below are my env file details:
MAIL_MAILER=smtp
MAIL_HOST=smtp.sendgrid.net
MAIL_PORT=587
MAIL_USERNAME=apikey
MAIL_PASSWORD=my_api_key
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=customer_invoices@o1.eu
MAIL_FROM_NAME="Laravel - DEV"
Please guide me how I can get my SMTP to work.
We’ve used different options, but nothing really worked out. Any idea what we’re doing wrong?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Heya,
The issue is not coming from your Laravel Application or DigitalOcean. You need to allow the domain you’ll send messages from on your mail provider.
Hey Ondrej 👋
The error
550 5.7.1 Sending from domain o1.eu is not allowed
usually means your from address domain (o1.eu) isn’t properly authenticated. Even though you switched providers, you still need to verify and set up SPF, DKIM, and possibly DMARC records foro1.eu
in your DNS settings.I think that you should be able to do that by:
o1.eu
) → Follow the DNS setup instructions.Once that’s done, SendGrid will allow you to send emails from that domain without hitting the 550 error.
- Bobby
I am facing the same problem. Some of my Laravel Projects are hosted on different droplets across different accounts and all the droplets are failing to send emails using my smtp mailers. I have used same mailers on the apps deployed on Microsoft Azure and thay are working fine there.
Failed to send test email. Detailed error: Connection could not be established with host “smtp.mailersend.net:587”: stream_socket_client(): Unable to connect to smtp.mailersend.net:587 (Connection timed out) #0 [internal function]: Symfony\Component\Mailer\Transport\Smtp\Stream\SocketStream->{closure:Symfony\Component\Mailer\Transport\Smtp\Stream\SocketStream::initialize():153}()`
Few Days Ago this was working perfectly fine but now all of the sudden it just stopped.
Even tried Gmail’s SMTP Server openssl s_client -connect smtp.gmail.com:587 -starttls smtp Still same issue.