Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

naspy971's avatar

Laravel 5.6 - How to easily send mail not using smtp authentication

Hi,

I've been through some struggles lately trying to send mails with swiftmailer natively in a production environment using real smtp providers such as gmail or sendgrid. But it looks like my hosting provider (1and1) block the ports used by gmail or sendgrid. Before putting this app on production, there was an older app not using laravel and using mail() function to send mails, and it was working well.

So not I'm at the point where I need not to use smtp provider credentials anymore, because very few emails will be sent, and none and the previous solutions worked for me.

I've not been able to find a solution working for me on how to configure Laravel swift mailer not using smtp credentials in Laravel 5.6, I'm only using .env file for email configurations by the way.

[UPDATE]

I finally got through this issue by getting a mailgun account ( the free one by that requires payment informations ), and using the mailgun configuration https://laravel.com/docs/5.2/mail and setting up the dns part in my hosting provider, and now it works, no need for smtp anymore !

Thanks

0 likes
2 replies
pawelmysior's avatar
Level 15

Have you considered using Mailgun? You get 10 000 emails for free every month and the integration with Laravel is super easy.

naspy971's avatar

@PawelMysior We can use port 2525 as well, so I tried that, but the sandbox domain works only in dev, and I got stuck on configuring a DNS in a real domain, so I'm looking for something else.

1 like

Please or to participate in this conversation.