SendGrid integration¶
You can send emails from your applications via SendGrid by configuring mail transfer agent OpenSMTPD:
- Make sure your application stack has enabled OpenSMTPD service
- Log in to your SendGrid account and visit guide https://app.sendgrid.com/guide
- Start with
Integrate using our Web API or SMTP relay
option - Choose
SMTP Relay
- Enter API Key to generate password
- Add the following environment variables to OpenSMTPD service (replace
[Tokens]
with your values):RELAY_HOST=[Server] RELAY_USER=[Username] RELAY_PASSWORD=[Password]
- Proceed to the next step in SendGrid dashboard to verify integration
- Send a test email from OpenSMTPD container