Set up Amazon SES, SendGrid, or other SMTP providers for reliable email delivery.
Proper SMTP configuration is critical for successful phishing campaigns. This tutorial covers setup for popular email service providers including Amazon SES, SendGrid, and custom SMTP servers. You'll also learn how to configure SPF, DKIM, and DMARC records to ensure deliverability and avoid spam filters.
GoPhish Sending Profiles - SMTP Configuration Interface
SMTP (Simple Mail Transfer Protocol) is the standard protocol for sending emails. GoPhish requires SMTP credentials to deliver phishing simulation emails to your targets.
| Field | Description | Example |
|---|---|---|
| Host | SMTP server address and port | smtp.gmail.com:587 |
| Username | SMTP authentication username | AKIAIOSFODNN7EXAMPLE |
| Password | SMTP password or API key | wJalrXUtnFEMI/K7MDENG |
| From Address | Sender email address | security@company.com |
Amazon Simple Email Service (SES) is a cost-effective, scalable email service. It's ideal for high-volume campaigns and integrates seamlessly with AWS infrastructure.
# Using AWS CLI to verify domain
aws ses verify-domain-identity --domain company.com
# Response includes verification token
{
"VerificationToken": "abc123def456..."
}
Add the verification records to your domain's DNS configuration:
# Domain Verification TXT Record
_amazonses.company.com TXT "abc123def456..."
# DKIM Records (3 CNAME records provided by SES)
token1._domainkey.company.com CNAME token1.dkim.amazonses.com
token2._domainkey.company.com CNAME token2.dkim.amazonses.com
token3._domainkey.company.com CNAME token3.dkim.amazonses.com
Important: New SES accounts start in "Sandbox Mode" with strict limits. You can only send to verified email addresses and are limited to 200 emails per day. Request production access to remove these restrictions.
# Generate SMTP credentials in SES Console
# Navigate to: SMTP settings → Create SMTP credentials
# You'll receive:
SMTP Username: AKIAIOSFODNN7EXAMPLE
SMTP Password: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
# SMTP Endpoint (varies by region)
# US East (N. Virginia): email-smtp.us-east-1.amazonaws.com
# US West (Oregon): email-smtp.us-west-2.amazonaws.com
# EU (Ireland): email-smtp.eu-west-1.amazonaws.com
POST /api/smtp/
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
{
"name": "Amazon SES - Production",
"host": "email-smtp.us-east-1.amazonaws.com:587",
"username": "AKIAIOSFODNN7EXAMPLE",
"password": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
"from_address": "security@company.com",
"ignore_cert_errors": false,
"headers": [
{
"key": "X-SES-CONFIGURATION-SET",
"value": "gophish-tracking"
}
]
}
SendGrid is a popular email delivery platform with excellent deliverability rates and detailed analytics.
# SendGrid will provide DNS records to add:
# CNAME Records for DKIM
s1._domainkey.company.com CNAME s1.domainkey.u12345.wl.sendgrid.net
s2._domainkey.company.com CNAME s2.domainkey.u12345.wl.sendgrid.net
# CNAME for link branding (optional)
email.company.com CNAME u12345.wl.sendgrid.net
POST /api/smtp/
Authorization: Bearer YOUR_API_KEY
{
"name": "SendGrid - Production",
"host": "smtp.sendgrid.net:587",
"username": "apikey",
"password": "SG.abcdef123456789...",
"from_address": "security@company.com",
"ignore_cert_errors": false
}
# Note: Username is literally "apikey" - the API key goes in password field
You can use your organization's existing mail server, but ensure it supports TLS and has proper authentication.
| Provider | SMTP Server | Port |
|---|---|---|
| Gmail | smtp.gmail.com | 587 (TLS) |
| Microsoft 365 | smtp.office365.com | 587 (TLS) |
| Mailgun | smtp.mailgun.org | 587 (TLS) |
| Postmark | smtp.postmarkapp.com | 587 (TLS) |
# Microsoft 365 Example
{
"name": "Office 365 SMTP",
"host": "smtp.office365.com:587",
"username": "admin@company.com",
"password": "YourPassword123",
"from_address": "security@company.com",
"ignore_cert_errors": false
}
Proper DNS authentication records are essential for email deliverability. These records prove your emails are legitimate and prevent spoofing.
SPF specifies which mail servers are authorized to send email for your domain.
# SPF Record for Amazon SES
company.com TXT "v=spf1 include:amazonses.com ~all"
# SPF Record for SendGrid
company.com TXT "v=spf1 include:sendgrid.net ~all"
# SPF Record for Multiple Providers
company.com TXT "v=spf1 include:amazonses.com include:sendgrid.net ~all"
# SPF Record with your mail server
company.com TXT "v=spf1 include:amazonses.com ip4:203.0.113.0/24 ~all"
DKIM adds a digital signature to your emails, verifying they haven't been modified in transit.
# DKIM records are provided by your email service provider
# Amazon SES provides 3 CNAME records
# SendGrid provides 2 CNAME records
# Add these exactly as provided by your ESP
DMARC tells receiving servers what to do with emails that fail SPF or DKIM checks.
# Basic DMARC Record (monitoring only)
_dmarc.company.com TXT "v=DMARC1; p=none; rua=mailto:dmarc@company.com"
# Quarantine Policy (recommended for production)
_dmarc.company.com TXT "v=DMARC1; p=quarantine; pct=100; rua=mailto:dmarc@company.com"
# Reject Policy (strictest - use after testing)
_dmarc.company.com TXT "v=DMARC1; p=reject; pct=100; rua=mailto:dmarc@company.com; ruf=mailto:forensics@company.com"
# DMARC Parameters:
# p=none - Monitor only, don't take action
# p=quarantine - Mark as spam if authentication fails
# p=reject - Reject emails that fail authentication
# pct=100 - Apply policy to 100% of messages
# rua - Aggregate report email address
# ruf - Forensic report email address
Always test your SMTP configuration before launching campaigns.
# Test SMTP from command line
openssl s_client -starttls smtp -connect email-smtp.us-east-1.amazonaws.com:587
# You should see successful TLS connection
# Then test authentication:
AUTH LOGIN
# Enter base64 encoded username
# Enter base64 encoded password
# Verify DNS records
dig TXT company.com # Check SPF
dig TXT _dmarc.company.com # Check DMARC
dig CNAME s1._domainkey.company.com # Check DKIM
Problem: Authentication Failed
Problem: Emails Going to Spam
Problem: Connection Timeout
Problem: Rate Limiting
| Provider | Free Tier | Paid Pricing |
|---|---|---|
| Amazon SES | 62,000/month (from EC2) | $0.10 per 1,000 emails |
| SendGrid | 100/day forever | $15/month for 50k emails |
| Mailgun | 5,000/month for 3 months | $35/month for 50k emails |
| Postmark | 100 emails (trial) | $15/month for 10k emails |
Now that SMTP is configured, launch your first phishing simulation.
View Tutorial →Design effective templates that pass spam filters and test awareness.
View Tutorial →Having trouble with email delivery? Our support team can help troubleshoot SMTP issues.
Contact Support