So what ? Is not like you implement the SMTP protocol into your application to send emails. Any language under the sun has a SMTP implementation exposed as a library.
I agree that for a high load of sending email it can be beneficial to use an intermediate service. IMO a local sendmail is still preferred, but I see your point.
However, the Mailit service makes the client wait on the SMTP traffic too [1]. So with this particular service you now have to wait for both SMTP /and/ HTTP communication. Doesn't really speed thinks up :)
[1] https://github.com/dthree/mailit/blob/master/src/routes.js#L...
That depends, you could host the Mailit service in the same machine as the email server, which your application instances on other machines would call. This could be useful if you have multiple machines but only want to run a single email server.
So I can see the benefits of this approach
SMTP uses a stateful connection where HTTP is basically a single request/response. I.e. the device can close the HTTP connection after a single roundtrip where SMTP requires waiting for server responses after commands and then continuing the request.
Not sure if it's simpler on those devices to use an HTTP interface (because HTTP requires a bit more overhead data) but it might be simpler, sure.
Really, realistically, if your internet connectivity is too bad to support SMTP, it most likely won't work for HTTP either, and you probably should be using some custom UDP thingy with an appropriate retry strategy.
Creating the relay is the hard part of any mail service because even SMTP aside, you need to set DNS entries on your FROM domain to authorise your SMTP relay's IP (otherwise spam filters will just block your email). And if it's regular commercial mailshots then you'd need to register with one of the trusted services (which isn't free) and have all sorts of controls like rate limiting in place - again so you don't just get rejected as spam.
Honestly, I would welcome a complete ground up re-implementation of email - SMTP, POP/IMAP and all. The "very simple protocol, that's matured for decades now" is really just a mess of different protocols - different authentication models, different encryption methods, etc and all operating without a standard format for error handling. Plus all of the additional bloat bolted on to handle the swell of abuse that the email "network" has had to endure. There's nothing simple about email any more.
However going back to the topic: the unfortunate thing about this REST API is it seeks to solve the least complicated part of the whole SMTP stack.
I'd welcome that too, it's kinda sad nobody succeeded with "email 2.0", sure we have lots of attempts but I can't recall any major players. The best solutions to "fix email" were companies that advocated to not use email and use their closed platform.
What I can think of would be cool is something XMPP based with email fallback.
Update: I just did this google search:
java and email book david wood
and looked at the results.
The first hit is that book - it's name was actually Programming Internet Email - and it was by O'Reilly Media:
http://shop.oreilly.com/product/9781565924796.do
It has info on both the fundamental concepts and protocols of email, as well as examples in both Perl and Java.
Other results of that search show that there are multiple books about programming email (as can be expected), including a list of books about Internet email on an Oracle site:
Books on the JavaMail API and Internet Mail:
http://www.oracle.com/technetwork/java/javamail/index-139773...
Not all of those are exclusively about email, and some probably have overlapping content, but still, it shows (as Wood's book did too) that it is a big topic:
JavaMail API, by Elliotte Rusty Harold.
Internet Email, by David Wood.
Programmer's Guide to Internet Mail, by John Rhoton.
Internet Email Protocols: A Developer's Guide, by Kevin Johnson.
Java Network Programming, 2nd Edition, by Elliotte Rusty Harold.
Essential Email Standards: RFCs and Protocols Made Practical, by Pete Loshin.
Internet Messaging: From the Desktop to the Enterprise, by Marshall T. Rose and David Strom.
Internet E-Mail: Protocols, Standards, & Implementation, by Lawrence Hughes.
Managing IMAP, by Dianna Mullet and Kevin Mullet.
Professional Java Server Programming J2EE Edition.
Java Cookbook: Solutions and Examples for Java Developers, by Ian F. Darwin.
JavaServer Pages (JSP) Fast & Easy Web Development, by Aneesha Bakharia.
[1] From what I read about David Wood, he seemed to have a lot of experience with email (and other stuff) and had for some time, a company providing products and/or services in that area.
http://www.oreilly.com/pub/au/565
And that Java Cookbook by Ian Darwin is pretty good too - I have it.
Sorry, "its name was" :)
Still forget that rule sometimes.
[0] https://documentation.mailgun.com/en/latest/quickstart-sendi...
Using an HTTP API for this is a massive overkill.
* I'm aware using utf-8 like this may confuse older clients but I didn't have problem with anything relatively modern I tested the receiving on.
I wouldn't call it massive overkill. REST is extremely simple as well. You have to make an request anyways so it's just a question of preference how you connect to that the email sending service.
Do you implement your own HTTP communication every time you need it or do you use a library?
Just as for HTTP there are many good libraries for SMTP communication that you can easily use. No need to roll your own.
You're running a web server to emulate telnet. It's a massive overkill.
In general I agree that I'm not seeing a big advantage in having another service to keep up and maintain, just to wrap SMTP.
So simple and so mature it needs an RFC.
I'll take the http API I can figure out in 10 seconds because I make API requests all day over some ancient tech I don't even want to begin to understand.
Does that make me lazy and a shit developer? Probably. Do I care. Definitely not.
SMTP really is a very simple protocol, that's matured for decades now. Also it is fully specified by RFCs.
I can see why mail services that provide templating (eg Mandrill) have special APIs, they offer something different from sending regular emails.
This specific REST API seems more like a standin for sendmail, which IMO makes things only more complicated.