Transactional email for my own website

What do I need to use a mailinabox server , in order to have my php backend to automatically send an email to a new signed up user.

I mean after I setup mailinabox successfully.
I want to send automatically with my own created backend an email. I have my backend already working with mail gun. However I do wish to use my own mailinabox server.

I understand some people recommend sendgrid, but if I can code this myself, why would I use mailgun, or sendgrid? Isn’t that’s what mailinabox is for?

I want to know how can I configure the smtp settings into my laravel backend?
Is it technically possible?
Any suggestions or comments?

Absolutely.

I do not know Laravel, but you can add the SMTP server details … somehow. Check Laravel docs.

ETA* - What you need is in the Swiftmailer library. Hopefully that gives you a clue where to look.

Read Mail-in-a-Box Advanced Configuration Guide

Overkill … as Laravel will connect to a smtp server directly.

You should be able to replace the Mailgun login information with your MiaB information.

Typically, the advantage of using Mailgun, Sendgrid, etc., is they include list management features, so users are added to managed through lists on their servers, they automatically include opt-out links, marketing links, etc., as the services are intended for managing large lists and other related services.

MiaB is intended for personal or very small SOHO applications. It can be used for transactional email, but that isn’t the intended user base so it does not have the same mailing list features.

Can the two be used together? SOHO users mail via mailinabox, and then configure mailgun to send transactional email without running into identity issues?

Yes, just configure the necessary DNS records to support the service.

1 Like

I have all that working, but statements like this (in the advanced section of the guide) throw me off:

If you have other machines sending mail using a domain name hosted on your Mail-in-a-Box (e.g. a webserver, or any machine that has cron jobs you want to see the output of) we recommend that you configure those machines to relay their outbound mail via the Mail-in-a-Box. Otherwise those emails may be marked as spam by recipients.

So using (e.g. Mailgun) to send e-mail with the appropriate DNS records is enough? Is the separation the mg.domain.com and box.domain.com sufficient to allow both to send @domain.com e-mails without running into spam problems?

Yes, the only issue is whether you have your DNS records configured correctly. People screw these up all the time.

2 Likes

I found the other place that throws me off. Go to admin / Mail & Aliases / Instructions and see:

Use only this box to send as you

Your box sets strict email sending policies for your domain names to make it harder for spam and other fraudulent mail to claim to be you. Only this machine is authorized to send email on behalf of your domain names. If you use any other service to send email as you, it will likely get spam filtered by recipients.

Perhaps wording that needs tweaking in a future update.

It seems correct for the default configuration.

Provided that you configure your SPF and DMARC records correctly, yes.

The only wording change would be adding what I wrote above, but most users do not have the need to tweak their settings. Yours is an exceptional use case.

1 Like