Internet API vs SMTP Relay: How Ought to You Ship Your E-mail?


SendGrid’s Internet API and SMTP Relay are the 2 major strategies of integrating with and sending e-mail via SendGrid. You’ll be able to consider their variations like strategies of delivering a bundle: you can ship a bundle within the mail, or you can drive it to the vacation spot your self.

Whereas the strategies of supply are totally different, the tip outcome is identical: the bundle is obtained. Beneath, we’ll stroll you thru the ins and outs of our API vs. SMTP sending strategies.

Internet API

SendGrid’s Internet API sends mail by way of HTTP. Your server sends a message to SendGrid, and receives both a 250 message, indicating that the message was accepted by the receiving server, or a 400 or 500 message, indicating that one thing is improper, prohibiting us from processing the request.

When the whole lot is packaged appropriately, SendGrid can course of the request after which ship it to the meant recipient’s ISP that responds with both a 250 message or a 500 message of their very own, informing SendGrid whether or not or not the message was obtained. This course of is extra much like placing your bundle within the mailbox and letting the publish workplace evaluate its info and ship it for you.

Reminder: A 250 message out of your recipient’s ISP does not assure that the e-mail will attain their inbox—it signifies that the ISP has decided the deal with is legitimate and has accepted the message. As soon as accepted, the ISP then determines if it must be positioned within the inbox, junk folder, spam folder, or defer the message all collectively.

You’ll be able to study extra in regards to the server response messages in our e-mail error messages glossary entry.

SMTP relay

Sending e-mail by way of SMTP relay, or Easy Mail Switch Protocol, requires extra backwards and forwards dialog to ship a message to the meant recipient than the Internet API. In our instance, this technique is extra like delivering a bundle your self as a result of it requires further steps to finish the supply course of. When a sender makes use of SMTP to hook up with SendGrid, separate items of data should be handed backwards and forwards between SendGrid and its clients earlier than the message may be processed and despatched to the recipient ISP.

With SMTP, SendGrid has to examine the message, DNS, and authentication. Every of these will return a 250 message or a 400 or 500 message indicating that one thing is correct or improper individually. An analogous dialog has to happen between SendGrid and the receiving ISP earlier than the ISP can determine whether or not it’s going to ship, block, or ship the e-mail to the spam folder.

Learn an in-depth clarification of SMTP Relay in our weblog publish E-mail Message Stream 101.


Due to the additional “chatter” backwards and forwards throughout an SMTP connection, we propose that SendGrid clients use the Internet API when attainable for a number of causes:

  • SMTP relay creates a number of factors of potential failure, that means that there are extra locations within the dialog between the sender and SendGrid that might trigger a kind of “not okay” messages.
  • The Internet API is quicker. The additional backwards and forwards mandatory in SMTP relay could cause some (minimal) latency for purchasers who’re exterior of the USA, and thus farther from our inbound information facilities.
  • The Internet API additionally permits you to add an additional layer of safety to your program by using API keys. API keys permit you to generate an authentication credential separate out of your username password, which considerably lowers the possibility of somebody utilizing your account to ship spam or phish.

That being mentioned, SMTP is an e-mail commonplace and is used universally. The Internet API was created by SendGrid’s founders to attach with our system extra effectively and won’t be a viable choice for all customers. SMTP relay can be used to attach with an current utility like a CRM system or a mail consumer like Outlook. The Internet API is usually utilized by builders creating their very own merchandise.

To learn extra about SendGrid’s e-mail instruments and options, head over to our Documentation.


Please enter your comment!
Please enter your name here