Sending emails in Django with Namecheap’s cPanel email account

This guide is aimed at those who want to use their Namecheap cPanel email server to send out Django emails. I have found little to no documentation on this specific task and therefore would like to share my findings.

There are two steps to this process:

  1. Create your email account
  2. Add appropriate email settings to settings.py

Step 1:

Navigate to your cPanel and create a email account (this is documented by Namecheap here). You will need to remember three things:

  • Full email address (EMAIL_HOST_USER)
  • Password (EMAIL_HOST_PASSWORD)
  • cPanel url from your browser (EMAIL_HOST)

Step 2:

Populate settings.py file with following variables:

# Email settings
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'premium203.web-hosting.com'
EMAIL_PORT = 465
EMAIL_USE_SSL = True
EMAIL_USE_TLS = False
EMAIL_HOST_USER = 'your-new-email@yourdomain.com'
EMAIL_HOST_PASSWORD = 'your-email-password-for-this-account'

Important note: Namecheap offers “private email” (also known as business email). This service is different from your Namecheap cPanel email account and will require different settings. If you’re setting up your private email, then here is a Stackoverflow answer that should get you going.

Hope this helps.

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments