'Use email created on cpanel in django

I have created an email id on my cpanel, I want to use it in django.

As for gmail we write,

EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_USE_TLS = True
EMAIL_USE_SSL = False
EMAIL_PORT = 587
EMAIL_HOST_USER = '[email protected]'
EMAIL_HOST_PASSWORD = 'password'

What should we write for the id that has been created using cpanel.

I have no idea regarding this as I am a begineer.



Solution 1:[1]

For me I have a cpanel email created on NameCheap, during development I successfully configured the email. I was able to send the email from the configured one. But the Email was not using SSL or TLS because setting up the secure one was raising an error.

#MY EMAIL SETTING
EMAIL_BACKEND ='django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'mail.your_main_domain'  #Hosted on namecheap Ex: mail.pure.com
EMAIL_USE_TLS = False
EMAIL_PORT = 26 #This will be different based on your Host, for Namecheap I use this`
EMAIL_HOST_USER = 'your full email address' # Ex: [email protected]
EMAIL_HOST_PASSWORD = 'password' # for the email you created through cPanel. The password for that

If you are using Django All auth remember to set to use same email to send password reset links

DEFAULT_FROM_EMAIL = EMAIL_HOST_USER

Thanks

Solution 2:[2]

I have cpanel email created with hostafrica with SSL and TLS enable, also hosted my application on aws but decided not to use AWS SES. so I configure my email backends as follow:

EMAIL_BACKEND ='django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'mail.my_domain'
EMAIL_USE_TLS = True
EMAIL_PORT = 587 # I use this for SSL
EMAIL_HOST_USER = "no-reply@my_domain"
EMAIL_HOST_PASSWORD = "email_Password"

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Fahrer Feyton
Solution 2 saminglory