Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

SMTP Setup

Overview

AREA can send emails as a reaction in workflows using SMTP. This guide covers how to configure your SMTP server to enable the “Send Email” reaction.


Configuration

SMTP settings are configured via environment variables. See Configuration for full details.

Required Environment Variables

SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USERNAME=your-email@gmail.com
SMTP_PASSWORD=your-app-password
SMTP_FROM_EMAIL=your-email@gmail.com
SMTP_USE_TLS=true

Common SMTP Providers

ProviderHostPortNotes
Gmailsmtp.gmail.com587Requires App Password
Outlooksmtp-mail.outlook.com587Use account password
Yahoosmtp.mail.yahoo.com587Requires App Password
SendGridsmtp.sendgrid.net587Use API key as password

Gmail SMTP Setup

Gmail requires an App Password (not your regular password):

  1. Enable 2-Factor Authentication on your Google account
  2. Go to App Passwords
  3. Select “Mail” and your device
  4. Click “Generate”
  5. Use the 16-character password as SMTP_PASSWORD
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USERNAME=yourname@gmail.com
SMTP_PASSWORD=xxxx xxxx xxxx xxxx  # App Password
SMTP_FROM_EMAIL=yourname@gmail.com
SMTP_USE_TLS=true

Reactions

Send Email

Name: send_email

Description: Sends an email to a specified recipient.

Configuration:

{
  "to": "recipient@example.com",
  "subject": "Email Subject",
  "body": "Email body content"
}

Parameters:

FieldTypeRequiredDescription
tostringYesRecipient email address
subjectstringYesEmail subject line (max 200 chars)
bodystringYesEmail body content (max 5000 chars)

Example Workflows

1. Daily Reminder Email

Send yourself a reminder every day at 9 AM:

{
  "name": "Daily Reminder",
  "action_id": 1,
  "reaction_id": 1,
  "action_config": {
    "time": "09:00"
  },
  "reaction_config": {
    "to": "me@example.com",
    "subject": "Daily Reminder",
    "body": "Don't forget to check your tasks!"
  }
}

2. GitHub Star Notification

Get emailed when someone stars your repository:

{
  "name": "Star Alert",
  "action_id": "<new_star_on_repo_id>",
  "reaction_id": "<send_email_id>",
  "action_config": {
    "repo_name": "username/my-project"
  },
  "reaction_config": {
    "to": "me@example.com",
    "subject": "New GitHub Star!",
    "body": "Someone starred your repository!"
  }
}

3. Gmail to Personal Email Forward

Forward emails from a specific sender to another address:

{
  "name": "Forward Boss Emails",
  "action_id": "<email_received_from_id>",
  "reaction_id": "<send_email_id>",
  "action_config": {
    "sender": "boss@company.com"
  },
  "reaction_config": {
    "to": "personal@email.com",
    "subject": "Work Email Alert",
    "body": "You received an email from your boss!"
  }
}

Troubleshooting

Email Not Sending

  1. Check SMTP credentials:

    # Verify environment variables are set
    docker-compose exec server env | grep SMTP
    
  2. Test SMTP connection:

    import smtplib
    server = smtplib.SMTP('smtp.gmail.com', 587)
    server.starttls()
    server.login('user@gmail.com', 'app-password')
    
  3. Check workflow logs:

    curl http://localhost:8080/api/areas/1/logs \
      -H "Authorization: Bearer <token>"
    

Common Errors

ErrorCauseSolution
Authentication failedWrong passwordUse App Password for Gmail
Connection refusedWrong host/portVerify SMTP settings
TLS requiredMissing TLS configSet SMTP_USE_TLS=true
Recipient rejectedInvalid emailCheck recipient address

Gmail-Specific Issues

  • “Less secure app” error: Gmail no longer supports this. Use App Passwords instead.
  • “Sign-in attempt blocked”: Enable 2FA and use App Password.
  • Daily limit reached: Gmail limits to ~500 emails/day for personal accounts.