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

enthusiast14's avatar

Setting correct value in mail settings to send email using smtp server

  1. I am trying to send email using our smtp server in our laravel 5.8 version, in .env file -

MAIL_DRIVER=smtp MAIL_HOST=smtp.hostinger.com MAIL_PORT=587 [email protected] MAIL_PASSWORD=pass_here MAIL_ENCRYPTION=null

but email not sent !, when i put mail instead of smtp in mail_driver like MAIL_DRIVER=mail then things working. What does it mean? I did not find "mail" driver in documentation. is this the proper way to send email using our smtp server?

also it's look like sendmail service is being used in our hosting when sending emails (MAIL_DRIVER=mail is set in this case else not working)

So what is the proper way to send emails using smtp server with correct configuration??

  1. another thing is when email arrives at a gmail account i see something like that in from section in the email - [email protected] via srv284.main-hosting.eu

why it's showing "via"?! how to avoid showing it? please help.

0 likes
3 replies
aurawindsurfing's avatar

Hey @enthusiast14

An easy way to test if your emails are working is to use this app:

https://usehelo.com/

It has its own email settings that can be easily implemented. This way you will check if your app actually works and sends emails.

Then when you have that verified, switch it with your smtp credentials. This should get you on the right track.

enthusiast14's avatar

Ok i will test, but why it don't work when i put MAIL_DRIVER=smtp , but it works when i put MAIL_DRIVER=mail !, how is that logical?

Please or to participate in this conversation.