We already send mail through Microsoft 365. Do we need a SendGrid account to send receipts from our app?
SendGrid (email) or SMTP (email_smtp)?
Common question, written up by the Supero team.
1 answer
No. Import email_smtp and point it at your own server. Both services expose the same send_email operation with almost the same fields, so code written for one works against the other.
{"service_id": "email_smtp", "config_data": {
"smtp_host": "smtp.office365.com", "smtp_username": "receipts@yourco.com",
"smtp_password": "<app-specific password>", "default_from_email": "receipts@yourco.com"}}Port 587 with STARTTLS is the default. For implicit SSL, set smtp_port: 465 and smtp_use_ssl: true. Use an app-specific password, not the account password. base_url is also required for SMTP.
What you give up is tracking. With email, SendGrid's open and click tracking is on by default (track_opens, track_clicks). SMTP has no return channel, so you get sent_at and error_message on each message record and nothing about opens, clicks or bounces. SendGrid also accepts tags, scheduled_at and message_type, which SMTP doesn't.
Your answer
Know the answer? Sign in to post it. It takes an email address and a 6-digit code.
Sign in to answer