Basic Authentication for SMTP
Basic authentication allows you to connect your SMTP server to Chargebee using a username and password. This method works with most SMTP providers including SendGrid, AWS SES, Mailgun, and others.
Note
For Microsoft 365 and Google Workspace accounts, we recommend using OAuth Authentication for enhanced security.
Configuring Basic Authentication
To configure your SMTP server with username/password authentication:
- Navigate to Settings > Configure Chargebee > Email Notifications
- Click Configure SMTP server
- Select the Basic Auth tab
- Enter your SMTP server details:
- Host Name: Your SMTP provider's server address
- Username: Your SMTP account username
- Password: Your SMTP account password
- Encryption Type: SSL/TLS or STARTTLS
- Port Number: Your SMTP provider's port
- Click Validate and Send Test Email to verify your configuration
- Click Save once the test email is received
Recommended Ports
For secure email communication, use the following ports to connect with your SMTP servers:
| Port | Encryption | Usage |
|---|---|---|
| 465 | SSL/TLS | Secure SMTP (recommended) |
| 587 | STARTTLS | Secure SMTP submission (recommended) |
| 25 | None/STARTTLS | Standard SMTP |
| 2525 | STARTTLS | Alternative SMTP |
Note
To use a port not listed above,Contact Chargebee Support.
Provider-Specific Configuration
SendGrid
When configuring SendGrid as your SMTP provider:
- Host:
smtp.sendgrid.net - Username:
apikey(literally use the word "apikey") - Password: Your SendGrid API key
- Port: 587 (STARTTLS) or 465 (SSL)
AWS SES
When configuring AWS SES:
- Host:
email-smtp.<region>.amazonaws.com - Username: Your SMTP credentials (not IAM credentials)
- Password: Your SMTP password
- Port: 587 or 465
Gmail (Personal Accounts)
Warning
For Google Workspace business accounts, we recommend using OAuth Authentication instead.
For personal Gmail accounts with MFA enabled:
- Create an app password
- Use the app password instead of your regular password
- Host:
smtp.gmail.com - Username: Your Gmail address
- Password: Your app password
- Port: 587 (STARTTLS) or 465 (SSL)
Office 365 (Basic Auth)
Warning
Microsoft is deprecating basic authentication for Office 365. We recommend using OAuth Authentication for Microsoft 365 accounts.
If you must use basic auth:
- Host:
smtp.office365.com - Username: Your Office 365 email address
- Password: Your password or app password
- Port: 587 (STARTTLS)
Note
For Office 365, the username in SMTP settings must match the 'From Address' configured in Chargebee.
Important Notes
When configuring basic authentication:
- Test Email: Chargebee will verify the credentials by sending a test email.
- From Address: The 'From Address' will be taken from the email notification settings.
- To Address: The test email will be sent to the email address of the logged-in user.
- Sandbox Accounts: If using a provider's sandbox account, ensure you are a verified sender/receiver.
- MFA Accounts: If your email account has MFA enabled, you will need to create an app password.
- From Address Override: Some mail clients may override the 'From Address' you set in Chargebee.
Troubleshooting
Authentication Failure
Problem: "Authentication failure - please check your SMTP credentials"
Solution:
- Verify your username and password are correct
- Check if your account requires an app password (for MFA-enabled accounts)
- Ensure your SMTP account is active and not suspended
- For SendGrid, confirm you're using "apikey" as the username
Connection Timeout
Problem: Connection to SMTP server times out
Solution:
- Verify if the hostname is correct
- Check if the port is correct for your encryption type
- Ensure your firewall allows outbound connections on the SMTP port
- Try an alternative port (e.g., 2525 if 587 is blocked)
Emails Not Delivered
Problem: Test email succeeds but emails are not delivered to recipients
Solution:
- Check your email provider's sending limits
- Verify SPF and DKIM records are configured correctly
- Check if the recipient domain is blocking your emails
- Review your email provider's bounce and delivery reports
Frequently Asked Questions (FAQs)
1. How can I replace my legacy Gmail SMTP password with an app password?
Follow these steps:
- Create an app password in your Google account
- Update the SMTP configuration in Chargebee and replace the legacy password with the app password
2. Why am I getting "less secure app" errors with Gmail?
Google has deprecated "less secure app" access. You need to either:
- Use an app password (for personal accounts)
- Use OAuth Authentication (recommended for Google Workspace)
3. Can I use the same SMTP configuration for multiple Chargebee sites?
Yes, you can use the same SMTP server credentials across multiple Chargebee sites, but be mindful of your provider's sending limits.
Related Articles
- SMTP Configuration Overview - Overview of SMTP options
- OAuth Authentication - Configure OAuth for Microsoft 365 and Google
- DMARC Regulation - Understand DMARC and email deliverability
Was this article helpful?