SendGrid SMTP API
Import your contacts in minutes and enjoy flexible price plans with unlimited contacts. Create professional newsletters with our drag & drop editor and 70+ free templates. Powerful API. Drag & Drop Editor. Free Templates Available. Advanced Analytics. High Delivery Rate.
Disclaimer: I work at SendGrid.
Our SMTP API example recommends using the Swift_SmtpTransport library, which makes low-level socket connections to end systems. When configured with our example, Swift connects to our systems to deliver your message, and won't require an SMTP service on your end.
To integrate with SendGrid's SMTP API:
- Create an API Key with at least "Mail" permissions.
- Set the server host in your email client or application to
smtp.sendgrid.net. This setting is sometimes referred to as the external SMTP server or the SMTP relay.
- Set your username to the string
apikey. This setting is the exact string "apikey" and not the API key itself.
- Set your password to the API key generated in step one.
- Set the port to
587(or as specified below).
When submitting base64 encoded API key values, be sure you have not included any newline or whitespace characters by accident. This can happen when copying the encoded key from an environment that line wraps output. SMTP is a line-oriented protocol, and linefeed characters will prevent you from authenticating successfully.
If you are unsure which port to use, a TLS connection on port 587 is typically recommended. To better understand the difference between ports 465 and 587, see the Twilio SendGrid blog post, "What's the Difference Between Ports 465 and 587".
Click Here to Visit