Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

polarcubs's avatar

What are good reasons to use a transaction email service such as mailgun or mandrill?

What are good reasons to use a transaction email service such as mailgun or mandrill when I could just send through the school domain email account?

I'm just building a small website for a school as part of a school project. Most of the emails will be send to students, teachers and parents.

0 likes
20 replies
jekinney's avatar

Speed would be the main one. Depending on the amount of emails you send depends on further pros versus cons. For me even a small app I use mandrill for reporting and ease of use and it's free.

michaeldyrynda's avatar

Sending a HTTP request is almost always going to be orders of magnitude quicker than sending mail directly. Not to mention doing the latter, your user will generally have to wait for the mail() call to finish as it prevents the rest of the application flow until it completes. Your users shouldn't have to wait for email to send, email is one of those background / send it later kind of tasks.

1 like
MThomas's avatar

The chance that your email is marked as spam by the receiving provider is a lot smaler (at least thats my experience).

On the speed diference, I think it is even better to queue the email on à iron or beanstalk queue.

jimmy.puckett's avatar

To us there are 2 primary reason...

1) much higher probability of inbox penetration 2) nice interface to see how you email is reforming

You will never be able to build the quality reputation with your ip's as the services can. Especially if you are using a cloud service for you servers as you may have different ip's from box build to build, so you may get assigned an ip that a spammer was just using & you are firing that previous person's reputation.

2 likes
Magnetion's avatar

As some others noted, deliver-ability is a HUGE factor. We use SendGrid for all transaction emails and the delivery rate has been outstanding. This was always a struggle when sending through our own server.

As @MThomas noted, using queues for emails is also a great idea. Doing so allows this to happen in the background, without the using having to wait on the SMTP connection.

bashy's avatar

What reasons would you want to use your own server for emails, that's the question!

3 likes
polarcubs's avatar

Hmmm I just switched to using my school provided admin email account (via gmail smtp as they use google apps for education) just to experiment. I didn't feel any observable difference in speed so far. Is connecting to gmail and send http as well?

Most of the accounts I'm sending emails to are to teachers and students. So getting marked as spam seem unlikely too as we are part of the same domain address.

For the parents, I'm not sure though about the delivery part.

I like the graphs on Mandrill however, though I do not know how it could benefit me yet.

bashy's avatar

The thing is, you still need to use one gmail account to send the emails and you will get a limit on how many you can send. It would be just as easy to set some email address to send them (from mandrill/mailgun) since you get stats and clicks/open tracking. As well as being able to sign the emails so you know they came from the system itself.

jekinney's avatar

Gmail limit is 100 a day (fyi) and using mandrill the return email and send email is what ever you set it at. But as stated the information provided by mandrill and the cost of free if your app grows to say over 50 emails at once will notice the speed difference.

polarcubs's avatar

Hi all, after reading the responses, I decided to use a queue as well for learning purposes. I heard that IronMQ is probably the easiest to setup however a question comes to mind.

Since IronMQ is an online hosted queue (correct me for errors as I'm new to queues), how does it speed things up for me? I'm sending to Mandrill via HTTP, I'm sending to IronMQ via http too (I think). Given that Mandrill internally probably has a queue as well, what difference does it make for me to

  • Send to IronMQ -> Mandrill -> User's email
  • Send to Mandrill -> User's email

Thank you.

michaeldyrynda's avatar

The queue isn't to speed up the sending of mail. Queues are just somewhere to store an action to process at a later time.

The benefit of this, like using Mandrill or Mailgun, is to keep the use from waiting for the mail function to complete. The queue will be beneficial if you have other tasks you might want to background.

As your app grows, you might separate the mail and queue components so you can have a dedicated queue if you like that won't interfere with the number of messages you can send on the queue.

Both options are using HTTP so should be fast, but one is specifically for mail.

polarcubs's avatar

Hi @deringer, so if my only background task is sending emails, am I right to say that I should just send my email contents via http to Mandrill and not bother about sending those task to IronMQ first (hosted queue)?

Since sending to ironMq then Mandrill introduce 1 more possible point of failure (My server to IronMq to Mandrill), while for Mandrill it is 1 (during the sending from my server to mandrill server).

michaeldyrynda's avatar

Mandrill/Mailgun are purpose built for sending email, so yes, you should use them directly.

Using something like IronMQ would be if you need to run some task - like resizing an image for example - that you don't want your user to have to wait for.

polarcubs's avatar

Alright guess I just send the email straight to Mandrill instead of first to IronMQ then as Mandrill has an email queue on it's own. Though sending about 30 emails to Mandrill through HTTP, I found that it took about 8 seconds to complete before redirection. Hope that is acceptable.

michaeldyrynda's avatar

If it's taking 8 seconds, I wouldn't consider that to be acceptable.

Have a look in the docs about queueing mail. See if that improves performance for you.

1 like
polarcubs's avatar

Hi @deringer, Since IronMQ is an online hosted queue (if I'm not wrong) does that mean that even if I use IronMQ, my site perceived performance for sending bulk emails to students and parents of a class still of the same speed (Mandrill directly).

Sorry for sounding so confused. Does that mean to speed it up from 8 seconds, I have to use a local queue instead?

zoransa's avatar

For small schools you most probably would fit in 'free account' or some under 10 dollars package. You know I starter long time ago with SendGrid and I made right choice. First deliverability was much greater, I did not have trouble with making my IPs marked for SPAM, we warmed up IP steadily and when website took off to hundreds of thousands of users we still are able to send newsletter that has huge deliverability, open rate of 30% or more not hitting promotions, updates or similar 'tabs'.

richbreton's avatar

@polarcubs that is why you want to use your own queue its way faster to offload that than to make several http requests to something off net

Please or to participate in this conversation.