Blog

Mail configuration in laravel 5

In Laravel 5, mail configuration need to be done in .env file and mail.php files. In one of our projects, we have used the thrid
party mail server ‘mailgun’ for sending mail.

In .env file:

 

 

In the above configuration, the issue which we have faced was ‘mail driver’. Initially, it was ‘SMTP’ and then after lot of attempts,
we have used ‘sendmail’ as mail driver and it was worked ( Note: we have used godaddy hosting).

Once we configure the .env file and we need to add the same details in ‘config/mail.php’ file with additional information such as ‘from’ email address

In config/mail.php

 

Note:

you need to make sure that ‘ from email address’ should have domain name where you have hosted your application. For example: your website name is www.example.com. then
your from mail address may be ‘notify@example.com’ or ‘contact@example.com’ and it should not be like ‘contact@someotherwebsite.com

Leave a Reply

Your email address will not be published. Required fields are marked *