To integrate with SendGrid's SMTP API:
smtp.sendgrid.net. This setting is sometimes referred to as the external SMTP server or the SMTP relay.
apikey. This setting is the exact string "apikey" and not the API key itself.
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".
Now that you've integrated, learn to build SMTP email.
Let us know how we’re doing! Please rate this page:
Please note, we cannot resolve account and login issues reported on GitHub. Contact support for account assistance.
Thanks for helping us improve our docs!