How to setup emails with SendGrid for TrueNAS

SendGrid is a great way of getting emails sent from your TrueNAS if you don’t have an email relay or your emails get blocked by spam fliters.

Get ready in SendGrid

  1. Create and verify your free SendGrid account.
  2. Verify your domain or email address with SendGrid.
  3. Create an API key. It only needs send access. Copy the API key somewhere safe.

Setup TrueNAS

Log into your TrueNAS web UI:

  1. Go to Accounts > Users:
    1. Edit the root user
    2. Set an email address from step 2 and save.
  2. Go to System > Email and set:
    1. ‘From email address’ to the email from step 2
    2. ‘From name’ to something that isn’t an email address (eg, ‘FreeNAS’)
    3. ‘Outgoing mail server’ to ‘smtp.sendgrid.com’
    4. ‘Mail server port’ to ‘2525’ (or ‘587’)
    5. ‘Security’ to ‘TLS’
    6. ‘SMTP Authentication’ to enabled
    7. ‘Username’ is ‘apikey’
    8. Password is the API key from step 3.
  3. Save it.
  4. Click ‘Send test email’. You should hopefully receive an email.

Troubleshooting

If it doesn’t work, make sure you’ve:

  • set the API key correctly
  • verified sender authentication is working – try sending an email with telnet
  • the emails match what you’ve verified
  • if you use your own domain, try setting your localdomain to your domain
  • your ISP isn’t blocking the outgoing port.

Leave a Comment