0

This is quite strange as email sending using my Gmail SMTP server works in my localhost, but when I deployed it on a VPS, it wouldn't work at all.

I can't find any issue as to why this is happening, the configuration looks normal (SSL port 465, Gmail SMTP server). I'm using Laravel 4.0.9 so I thought of upgrading to 4.1/4.2 to use the Mailgun feature (not sure if 4.0 can use Mailgun?)

Anyway, for a quick fix, I just switched to mail method for email sending. Since this works well for me, my question is that whether there is any tradeoff of using mail instead of SMTP on Laravel? The delivery seems okay as it got to my inbox, but what about the long term?

Any thoughts would be very much appreciated :)

user3583721
  • 327
  • 2
  • 4
  • 14

2 Answers2

1

When using the built-in mail function you don't benefit from additional features such as DKIM and the SFP configuration for your domain may not allow hosts other than your SMTP mail server to send mail for your domain, all of this makes the mail you send that way look like spam to other servers.

While you may not have issues with some providers, try to send mail to some more restrictive providers such as Outlook (ex-Hotmail); I'm pretty sure all the mail you send there will be automatically marked as spam because of the issues described above.

  • What do you think about the issue I have described above about not sending SMTP email in VPS? BTW - just wondering if you know Laravel 4.0.9 can used Mailgun? – user3583721 Oct 11 '14 at 04:15
  • @user3583721 look at the [documentation](http://laravel.com/docs/4.2/mail), looks like Laravel 4.2 has drivers for Mailgun. Not sure about earlier versions though, but you should try to upgrade. –  Oct 11 '14 at 04:18
  • About the issue with Gmail not working on your VPS... well, check the logs for any errors. If it works on your computer there's no reason it won't work on your server, I'm pretty sure it's just a PHP configuration issue. –  Oct 11 '14 at 04:20
0

PHP mail may be faster since you don't have to connect to your smtp server, but it's not better. In the long run, SMTP email is the only way to guarantee that your email will arrive in the inbox of your receivers

Naveed Ahmad
  • 314
  • 6
  • 18