Outgoing mail

Published 9 months ago by deansatch

For years when building websites with or without laravel I have been using smtp for sending mail. Generally I would add a mail settings page in the cms where the user can set their email, password, port etc...

This has worked fine so far apart from occasions when they change their email password and forget to reflect that within their site which can cause serious nightmares for the ones that rely on the emails for their business to function. Also more recently I’ve noticed gmail blocking them

What are people’s best solutions for sending email from sites, baring in mind that some sites may be one man bands on a tight budget and some might need their site to send 100s of emails a day, or even 100s per minute

I don’t mean queues...just the outgoing server setup and avoiding failed jobs due to password changes or email downtime (a fall back second address could be another subject)

Best Answer (As Selected By deansatch)
bashy

@deansatch Basically, you add a new subdomain to send the mail. Some domains have multiple (mail1. mail2. mail3. etc). I use something like mail. and then add the required DNS entries to that subdomain. This includes SPF, A, MX, and CNAME for everything relating to email tracking and sending.

You would then set the from address as [email protected] and add reply-to etc. You can route inbound emails but not really had to do that before.

bashy
bashy
9 months ago (1,002,650 XP)

As a lot of people do - use a mail service. They provide SMTP or even better, an API.

deansatch

@bashy recommendations? Again baring in mind some may be large corporations and some are one man bands that just need a simple form on their site for the occasional user so won't be impressed with a £20/month mail service

bashy
bashy
9 months ago (1,002,650 XP)

@deansatch I use a mixture depending on the client but Mailgun and Postmark are two I use a lot.

Mailgun has 10k free per month and it's dirt cheap after that as well. Postmark is good for deliverability and support. Both work great in Laravel using the API (I don't use SMTP these days. Lots of noise).

deansatch

@bashy what confuses me about this is if the mail is to come from something like [email protected] and they already have their own email addresses set up, how can something like mailgun do this without authenticating? Or does it have to be sent from a @mailgun.com address?

bashy
bashy
9 months ago (1,002,650 XP)

@deansatch Basically, you add a new subdomain to send the mail. Some domains have multiple (mail1. mail2. mail3. etc). I use something like mail. and then add the required DNS entries to that subdomain. This includes SPF, A, MX, and CNAME for everything relating to email tracking and sending.

You would then set the from address as [email protected] and add reply-to etc. You can route inbound emails but not really had to do that before.

Please sign in or create an account to participate in this conversation.