# Email Notifications

Email notifications allow CoderFlow to send messages when users are mentioned in comments or when others comment on their tasks and objectives.

## Configuration

Navigate to **Settings → Email** to configure SMTP settings:

- **SMTP Host** — Your mail server hostname (e.g., `smtp.office365.com`)
- **Port** — SMTP port (typically `587` for STARTTLS or `465` for SSL)
- **Use SSL/TLS** — Enable for port 465; leave disabled for port 587 with STARTTLS
- **Username** — SMTP authentication username
- **Password** — SMTP authentication password
- **From Address** — Email address shown as the sender
- **From Name** — Display name shown alongside the sender address (optional)

After entering your settings, use **Test Connection** to verify the SMTP server is reachable, then **Send Test Email** to confirm full delivery.

## User Preferences

Each user can control which notifications they receive via **Profile Settings → Email Notifications**:

- **@Mentions** — Receive emails when mentioned in comments
- **Comments on my tasks/objectives** — Receive emails when others comment on tasks or objectives you created

Users must have an email address configured in their profile to receive notifications.

## Provider-Specific Notes

### Office 365

Use `smtp.office365.com` on port `587` with SSL/TLS disabled (STARTTLS is used automatically). Ensure your account allows SMTP authentication — you may need to enable "Authenticated SMTP" in the Microsoft 365 admin center for the sending account.

### Gmail

Use `smtp.gmail.com` on port `587` with SSL/TLS disabled. Gmail requires an App Password rather than your regular account password. Generate one at [Google Account → Security → App Passwords](https://myaccount.google.com/apppasswords). You must have 2-Step Verification enabled.

### SendGrid

Use `smtp.sendgrid.net` on port `587`. The username is literally `apikey` and the password is your SendGrid API key.

### AWS SES

Use `email-smtp.<region>.amazonaws.com` on port `587` (replace `<region>` with your AWS region, e.g., `us-east-1`). SES SMTP credentials are different from your AWS access keys — generate them in the AWS SES console under "SMTP Settings".

## Troubleshooting

### Connection Timeout

- Verify the SMTP host and port are correct
- Check that your firewall or network allows outbound connections on the SMTP port
- Some cloud providers block port 25; use port 587 or 465 instead

### Authentication Failed

- Verify your username and password are correct
- For Gmail, ensure you're using an App Password, not your regular password
- For Office 365, confirm SMTP authentication is enabled for the account

### Emails Not Received

- Check the recipient's spam/junk folder
- Verify the From address is valid and authorized to send from your mail server
- For SES, ensure the From address is verified in your SES configuration

### Certificate Errors

- If using a self-signed certificate on your mail server, you may need to configure your environment to trust it
- Ensure your server's system time is correct, as certificate validation depends on accurate timestamps
