Email providers enable Guard Dog to send two-factor authentication codes via email. Instead of relying on WordPress’s default wp_mail() function (which is often unreliable), you can configure a professional email service for guaranteed delivery.
Why Configure an Email Provider?
WordPress default email is unreliable:
- May not work at all on many hosts
- Often ends up in spam folders
- No delivery tracking or confirmation
- Poor reputation with email providers
Professional email providers offer:
- ✅ Guaranteed delivery
- ✅ Better inbox placement (not spam)
- ✅ Delivery tracking and analytics
- ✅ Higher sending limits
- ✅ Better reputation and authentication
When you need email provider:
- Using email-based 2FA
- Sending password reset emails
- Sending temporary access links (future feature)
- Any critical transactional emails
Supported Email Providers
Guard Dog supports three enterprise email providers:
1. Amazon SES (Simple Email Service)
Best for:
- High-volume sending
- AWS infrastructure users
- Technical teams comfortable with AWS
- Cost-conscious high-volume senders
Pricing:
- $0.10 per 1,000 emails
- Extremely cost-effective at scale
- Free tier: 62,000 emails/month (if using EC2)
Pros:
- Very reliable
- Excellent deliverability
- Scales infinitely
- Very affordable
Cons:
- AWS account required
- More complex setup
- Requires IAM user and credentials
- Sandbox mode initially (need to request production)
2. Resend
Best for:
- Modern developers
- Small to medium sites
- Simple setup
- API-first approach
Pricing:
- Free tier: 100 emails/day
- Paid: $20/month for 50,000 emails
- Usage-based pricing above that
Pros:
- Simple, modern API
- Easy to set up
- Good documentation
- Generous free tier
- Developer-friendly
Cons:
- Newer service (less established)
- Higher cost at very high volumes
- Fewer features than AWS SES
3. SendGrid
Best for:
- Established solution
- Marketing + transactional emails
- Need for advanced features
- Enterprise support
Pricing:
- Free tier: 100 emails/day
- Essentials: $19.95/month for 50,000 emails
- Pro: $89.95/month for 100,000 emails
Pros:
- Very established and reliable
- Excellent deliverability
- Advanced features (templates, analytics)
- Good support
Cons:
- More expensive than SES
- Overkill for simple 2FA emails
- More complex than Resend
Quick Comparison
| Provider | Setup Difficulty | Free Tier | Best For | Cost at 10K/mo |
|---|---|---|---|---|
| Amazon SES | Hard | 62K/mo* | High volume | $1 |
| Resend | Easy | 3K/mo | Small/medium | $20 |
| SendGrid | Medium | 3K/mo | Enterprise | $19.95 |
*With EC2 hosting
Recommendation for most users: Start with Resend for simplicity, or Amazon SES if you’re comfortable with AWS.
Setting Up Email Providers
Amazon SES Setup
Step 1: Create AWS Account
- Go to aws.amazon.com
- Sign up for an AWS account
- Verify your email and payment method
Step 2: Access SES Console
- Log in to AWS Console
- Search for “SES” in the services search
- Click “Amazon Simple Email Service”
- Select your preferred region (e.g., us-east-1)
Step 3: Verify Your Email Address
- In SES console, go to Verified Identities
- Click Create Identity
- Choose Email address
- Enter your “From” email address (e.g.,
[email protected]) - Click Create Identity
- Check your email for verification link
- Click verification link
Step 4: Verify Your Domain (Recommended)
- In SES console, go to Verified Identities
- Click Create Identity
- Choose Domain
- Enter your domain (e.g.,
yoursite.com) - Click Create Identity
- Add the provided DNS records to your domain:
- DKIM records (for authentication)
- MAIL FROM record (optional but recommended)
- Wait for verification (can take up to 72 hours)
Step 5: Request Production Access
- In SES console, click Account Dashboard
- Note: You start in “Sandbox” mode (can only send to verified addresses)
- Click Request Production Access
- Fill out the form:
- Use case: Transactional emails
- Website URL: Your site
- Describe how you handle bounces
- Daily sending quota: Start with 50,000
- Submit request
- AWS usually approves within 24 hours
Step 6: Create IAM User
- Go to IAM console (search “IAM” in AWS)
- Click Users → Add User
- Username:
guarddog-ses(or similar) - Access type: Programmatic access
- Click Next: Permissions
- Click Attach existing policies directly
- Search for and select: AmazonSESFullAccess
- Click Next through to Create User
- IMPORTANT: Copy the Access Key ID and Secret Access Key
- You won’t be able to see the secret key again!
- Store them securely
Step 7: Configure in Guard Dog
- Go to Guard Dog → Settings → Email Provider
- Select Amazon SES from dropdown
- Enter configuration:
- Access Key ID: From step 6
- Secret Access Key: From step 6
- Region: Your SES region (e.g.,
us-east-1) - From Email: Your verified email address
- From Name: Your site name (e.g., “My WordPress Site”)
- Click Save Settings
- Click Send Test Email to verify
Resend Setup
Step 1: Create Account
- Go to resend.com
- Click Sign Up
- Create account with email/GitHub/Google
- Verify your email address
Step 2: Add Your Domain
- In Resend dashboard, click Domains
- Click Add Domain
- Enter your domain (e.g.,
yoursite.com) - Click Add
- Add the provided DNS records to your domain:
- SPF record
- DKIM record
- Click Verify DNS Records
- Verification usually instant or within minutes
Step 3: Create API Key
- In Resend dashboard, click API Keys
- Click Create API Key
- Name:
Guard Dog(or similar) - Permission: Sending access
- Click Create
- Copy the API key – You won’t see it again!
- Store it securely
Step 4: Configure in Guard Dog
- Go to Guard Dog → Settings → Email Provider
- Select Resend from dropdown
- Enter configuration:
- API Key: From step 3
- From Email: Your verified domain email (e.g.,
[email protected]) - From Name: Your site name
- Click Save Settings
- Click Send Test Email to verify
SendGrid Setup
Step 1: Create Account
- Go to sendgrid.com
- Click Sign Up
- Fill out registration form
- Verify your email address
- Complete account setup wizard
Step 2: Verify Sender Identity
- In SendGrid dashboard, go to Settings → Sender Authentication
- Click Authenticate Your Domain (recommended)
- Or Verify a Single Sender (simpler but less reliable)
- For domain authentication:
- Enter your domain
- Add provided DNS records
- Click Verify
- For single sender:
- Enter your email and details
- Click verification link in email
Step 3: Create API Key
- In SendGrid dashboard, go to Settings → API Keys
- Click Create API Key
- Name:
Guard Dog - Permission: Restricted Access
- Enable: Mail Send → Full Access
- Everything else: No Access
- Click Create & View
- Copy the API key – You won’t see it again!
- Store it securely
Step 4: Configure in Guard Dog
- Go to Guard Dog → Settings → Email Provider
- Select SendGrid from dropdown
- Enter configuration:
- API Key: From step 3
- From Email: Your verified email
- From Name: Your site name
- Click Save Settings
- Click Send Test Email to verify
Configuration Fields
Common Fields (All Providers)
From Email:
- The email address that appears as sender
- Must be verified with your provider
- Example:
[email protected],[email protected] - Important: Use a real domain you own
From Name:
- The friendly name that appears as sender
- Example: “My WordPress Site”, “ACME Security”
- Shows in email client as: “From Name [email protected]“
Provider-Specific Fields
Amazon SES:
- Access Key ID – Your IAM user’s access key
- Secret Access Key – Your IAM user’s secret key
- Region – AWS region where you configured SES (e.g., us-east-1, eu-west-1)
Resend:
- API Key – Your Resend API key
SendGrid:
- API Key – Your SendGrid API key
Testing Your Configuration
After configuring your email provider:
Send Test Email
- Click Send Test Email button
- Enter a test email address (your email)
- Click Send
- Check your inbox (and spam folder)
- You should receive: “Guard Dog Email Provider Test”
If test succeeds:
- ✅ Configuration is correct
- ✅ Email provider is working
- ✅ DNS records are properly configured
- ✅ Email authentication is working
If test fails:
- ❌ Check your API credentials
- ❌ Verify DNS records are added
- ❌ Check provider dashboard for errors
- ❌ Ensure from email is verified
- ❌ Check debug logs in Guard Dog settings
Test 2FA Email
To test the full 2FA flow:
- Enable email 2FA in Login Security
- Go to your User Profile
- Enable email 2FA for your account
- Log out
- Log back in
- You should receive a 2FA code via email
- Enter the code to complete login
Troubleshooting
Test Email Not Received
Check these in order:
- Spam folder
- Email may be filtered as spam
- Add sender to safe list
- Provider dashboard
- Log in to your email provider
- Check delivery logs
- Look for bounces or errors
- API credentials
- Verify API key is correct
- Check for copy/paste errors
- Ensure key has sending permissions
- DNS records
- Verify DNS records are added correctly
- Use DNS checker tools
- Wait for DNS propagation (up to 48 hours)
- Sender verification
- Ensure from email is verified
- For SES: Check production access status
- For SendGrid/Resend: Verify domain or sender
- Debug logs
- Enable debug logging in Guard Dog
- Check Settings → Debug
- Look for API error messages
Wrong Sender Email Appears
Problem: Emails come from wrong address
Cause: From email not verified or overridden
Solution:
- Verify the from email in provider dashboard
- Check Guard Dog email provider settings
- Ensure from email matches verified address
“Not Authorized” or “Access Denied” Error
Amazon SES:
- IAM user needs
AmazonSESFullAccesspolicy - Access key and secret key must be correct
- Region must match where you configured SES
Resend:
- API key must have “Sending access” permission
- Check for typos in API key
SendGrid:
- API key must have “Mail Send” full access
- Verify API key is not expired
Emails Going to Spam
Causes:
- Domain not authenticated (no SPF/DKIM)
- Shared IP with poor reputation
- Content triggers spam filters
Solutions:
- Authenticate your domain:
- Add all SPF, DKIM, DMARC records
- Use provider’s domain authentication
- Use dedicated IP (advanced):
- Available in paid plans
- Costs extra but improves deliverability
- Warm up your sending:
- Start with low volume
- Gradually increase over weeks
- Builds sender reputation
- Content best practices:
- Avoid spam trigger words
- Use plain text or simple HTML
- Include unsubscribe link (for marketing)
High Bounce Rate
Problem: Emails bouncing back
Causes:
- Invalid recipient email addresses
- Temporary server issues
- Email addresses no longer exist
Solutions:
- Verify email addresses:
- Test with known good addresses
- Remove invalid addresses from database
- Check bounce logs:
- Provider dashboard shows bounce reasons
- Hard bounces vs soft bounces
- Handle bounces properly:
- Remove hard-bounced addresses
- Retry soft bounces later
Best Practices
- Authenticate your domain – Always use SPF, DKIM, DMARC
- Use a dedicated subdomain –
mail.yoursite.comfor sending reputation - Monitor delivery rates – Check provider dashboard regularly
- Keep API keys secure – Never commit to version control
- Use environment variables – For API keys in production
- Test before going live – Send test emails thoroughly
- Set up bounce handling – Monitor and act on bounces
- Use descriptive from names – Help users identify legitimate emails
- Don’t use personal email – Use domain email for professionalism
- Have backup method – Consider fallback to wp_mail() if provider fails
Cost Management
Staying in Free Tiers
Amazon SES:
- Monitor monthly sending volume
- Free tier: 62,000/month with EC2 or $0.10 per 1,000
- Set up billing alerts in AWS
Resend:
- 100 emails/day = 3,000/month
- Enough for small sites with occasional 2FA
- Upgrade to $20/month for 50,000
SendGrid:
- 100 emails/day = 3,000/month
- Similar to Resend
- Good for small to medium sites
Optimizing Costs
- Only enable email 2FA if needed
- App-based 2FA doesn’t use email credits
- Email 2FA only when required
- Batch notifications (if sending bulk)
- Don’t send individual emails for each event
- Batch and send digest emails
- Clean your user list
- Remove bounced addresses
- Remove inactive users
- Reduces unnecessary sends
- Monitor usage
- Check provider dashboard monthly
- Set up usage alerts
- Upgrade plan before hitting limits
FAQ
Q: Do I need an email provider?
A: Only if you want email-based 2FA or reliable transactional emails. App-based 2FA doesn’t require email.
Q: Which provider is best?
A: Resend for simplicity, Amazon SES for cost/scale, SendGrid for enterprise features.
Q: Can I use my regular email service (Gmail, Outlook)?
A: Not recommended. They have sending limits and poor deliverability for automated emails.
Q: Will this affect my regular WordPress emails?
A: No. Guard Dog only uses the email provider for its own emails. Other WordPress emails still use wp_mail().
Q: Can I switch providers later?
A: Yes, just change the provider selection and update credentials.
Q: Do I need to configure DNS records?
A: Highly recommended for good deliverability. Not strictly required but emails may go to spam without them.
Q: What if email sending fails?
A: Users will see an error and can’t complete email 2FA. Have app-based 2FA as backup.
Q: How many emails will I send?
A: For 2FA: ~2 per user login. For 100 users logging in daily = ~200 emails/day.
Q: Can I use free email providers?
A: Yes, all three have generous free tiers sufficient for most small to medium WordPress sites.