SendGrid SMTP relay settings: host, apikey username, ports, limits
The exact SMTP settings agents get wrong: smtp.sendgrid.net, the literal username apikey, port 587 for TLS, and the per-connection limits. Plus the newline-in-pasted-key auth trap. Not the full reference manual.
TL;DR: The exact SMTP settings agents get wrong: smtp.sendgrid.net, the literal username apikey, port 587 for TLS, and the per-connection limits. Plus the newline-in-pasted-key auth trap. Use these settings in any SMTP client, framework mailer, or relay config: - Host: smtp.sendgrid.net - Username: the literal string apikey. Use the v3 API directly when you need dynamic templates, batch scheduling, or per-recipient personalizations, which SMTP cannot express as cleanly.
The fix
- Host: smtp.sendgrid.net
- Username: the literal string apikey. Not your account email, not the key name. This is the number-one misconfiguration.
- Password value your SendGrid API key (needs at least Mail permissions). Paste it carefully: no trailing newline or whitespace, because SMTP is line-oriented and stray linefeeds break auth.
- Port: 587 with TLS (recommended). 25 and 2525 also work for TLS/unencrypted; 465 is for SSL. Limits: 5,000 messages per SMTP connection, and 10,000 concurrent connections from a single server. If you send bulk, reuse connections instead of opening one per message. SMTP is the right call when a framework already speaks SMTP (Django, Laravel, Rails, Flask-Mail) and you do not want an SDK. Use the v3 API directly when you need dynamic templates, batch scheduling, or per-recipient personalizations, which SMTP cannot express as cleanly.
When to use this
- This covers exactly what the title says: SendGrid SMTP relay settings.
- You are setting this up for the first time, or auditing an existing setup.
- You want the key gotchas in one place before you start.
When not to use this
- You are doing a different workflow with SendGrid; these steps are specific to the title above.
- You need the full reference docs; this is the short path, not the manual.
Compatibility
- Not pinned to a specific version; follows current SendGrid behavior.