2

Laravel accepts many drivers for sending mail, but I can't find explanation about them neither on docs nor on internet at all, it's some kind of "black box". The only driver I really know what it does is "log", which is for testing.

Sometimes I got problems with a driver, I just randomly change to another and it magically works.

So, I would like to know the difference between "smtp", "mail" and "sendmail" drivers, the most used ones.

Leno Oliveira
  • 105
  • 1
  • 12
  • Have you googled any of them? These are all apps or protocols that have nothing to do with Laravel. Accessing them is configured in Laravel only. – Namoshek Jul 16 '19 at 04:31

1 Answers1

2

mail - this will use the mail function from your server to send emails. sendmail - you will need to install sendmail on your server and it will send emails using sendmail

smtp - you can set the settings of SMTP server settings that will send your emails. (for instance you can use your gmail smtp settings but this is not recommended). You can register for Mailgun and set their SMTP settings. You can also setup local server like Mailhog and use it to catch the emails which might be nice for testing.

ses - this one uses AWS SES.

log - sends all emails to log files.

naneri
  • 3,771
  • 2
  • 29
  • 53
  • Thanks for the answer, but it gave me more doubts: Why using gmail smtp settings is not recommended? Sendmail is an application that must be installed on server, but I never consciously installed or configured it, yet it works on my server. It comes bundled on Laravel or PHP? – Leno Oliveira Jul 19 '19 at 18:05
  • 1
    @Leno sendmail often comes preinstalled on Linux. Concerning gmail SMTP - you can use it to only sent email to the addresses that you can be sure that won't mark you as spam, because otherwise it will stop working very fast. Also gmail SMTP has rate limits, so you cant send a lot of emails. It is just an example and absolutely not a recommended solution. – naneri Jul 22 '19 at 06:31