Docs

Log into read the version of docs relevant to your site.

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:

  1. Navigate to Settings > Configure Chargebee > Email Notifications
  2. Click Configure SMTP server
  3. Select the Basic Auth tab
  4. 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
  1. Click Validate and Send Test Email to verify your configuration
  2. Click Save once the test email is received

For secure email communication, use the following ports to connect with your SMTP servers:

PortEncryptionUsage
465SSL/TLSSecure SMTP (recommended)
587STARTTLSSecure SMTP submission (recommended)
25None/STARTTLSStandard SMTP
2525STARTTLSAlternative 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:

  1. Create an app password
  2. 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:

  1. Verify your username and password are correct
  2. Check if your account requires an app password (for MFA-enabled accounts)
  3. Ensure your SMTP account is active and not suspended
  4. For SendGrid, confirm you're using "apikey" as the username

Connection Timeout

Problem: Connection to SMTP server times out

Solution:

  1. Verify if the hostname is correct
  2. Check if the port is correct for your encryption type
  3. Ensure your firewall allows outbound connections on the SMTP port
  4. 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:

  1. Check your email provider's sending limits
  2. Verify SPF and DKIM records are configured correctly
  3. Check if the recipient domain is blocking your emails
  4. 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:

  1. Create an app password in your Google account
  2. 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.

Was this article helpful?