django-registration sending activation and reset emails - django

I am trying to send activation and reset email in Django, but I am facing some challenges.
setting.py
EMAIL_BACKEND ='django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST ='smtp.gmail.com'
EMAIL_PORT = 587
EMAIL_USE_TLS =True
EMAIL_HOST_USER ='email#gmail.com'
EMAIL_HOST_PASSWORD ='gmailpasword'
EMAIL_BACKEND ='django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = ‘mail.mysite.com’
DEFAULT_FROM_EMAIL = 'noreply#mysite.com'
EMAIL_HOST_USER = 'noreply#mysite.com'
EMAIL_HOST_PASSWORD = 'my pass'
EMAIL_USE_TLS = True
EMAIL_PORT = port
The first configuration is with Gmail which work fine in development but in production (shared Linux server) it does not work at all. The second configuration with an email I set up on
webmail (cPanel) which is not working in either development or production.

Related

django, sendGrid not sending mail

I'm trying to send mail using SendGrid on django development server.
Here are my setting:
EMAIL_HOST = 'smtp.sendgrid.net'
DEFAULT_FROM_EMAIL = 'myemail#gmail.com'
EMAIL_USE_TLS = True
EMAIL_PORT = 587
EMAIL_USE_SSL = False
EMAIL_HOST_USER = 'apikey'
EMAIL_HOST_PASSWORD = config('PASS')
and it is not working, it returns 1 on the terminal and nothing happens.

Django multiple SMTP accounts

Here are the Django simple SMTP backend settings for just 1 email account
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = "mail.mysmtpserver.somewhere"
EMAIL_PORT = 587
EMAIL_HOST_USER = "my#login"
EMAIL_HOST_PASSWORD = "mypassword"
EMAIL_USE_TLS = True
How is it possible to use 2 or more email accounts on the same server instead of one?
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = "mail.mysmtpserver.somewhere"
EMAIL_PORT =587
EMAIL_HOST_USER = "my#login2"
EMAIL_HOST_PASSWORD = "mypassword2"
EMAIL_USE_TLS = True
I just need to send different emails based on the subject by different email account.
I checked the Django documentation but there was nothing

How to configure Django Email Back-end Settings to send email via RoundCube Webmail in production

During development, I have been using Gmail SMTP to send emails from my Django app. The Gmail settings are (settings.py):
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_USE_TLS = True
EMAIL_PORT = 587
EMAIL_HOST_USER = 'xxxx#gmail.com'
EMAIL_HOST_PASSWORD = 'xxxxxxxxx'
However, during production, I need to change to RoundCube webmail client to allow my project to use a custom email address that matches the domain name. I have tried the following settings and many others but none of them is working. I know this is simple, but this is my first project and I don't know whether there is something I am missing.
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'mydomain.com'
EMAIL_USE_TLS = True
EMAIL_PORT = 465
EMAIL_HOST_USER = 'accounts#mydomain.com'
EMAIL_HOST_PASSWORD = 'xxxxxxxxx'

Email is not sending in django after deploy in Cpanel

I just deploy a Django web app in Cpanel. But SMTP email is not working in Cpanel. It works only on my local machine. I don't have much knowledge about Cpanel.
Here is my code for setting.py:
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_USE_TLS = True
EMAIL_PORT = 587
EMAIL_HOST_USER = 'my gmail'
EMAIL_HOST_PASSWORD = 'password'
solved!! changed EMAIL_HOST_USER to cpnael hosting email.

What is EMAIL_PORT for protonmail.com mail service?

I tried to use https://protonmail.com email service for my django app to send notification emails. I googled and found that protonmail SMTPis 1026 and protonmail IMAP is 1143.
When I use gmail service it works fine.
My settings.py
EMAIL_HOST = 'smtp.protonmail.com'
EMAIL_HOST_USER = 'username#protonmail.com'
EMAIL_HOST_PASSWORD = 'password'
EMAIL_PORT = 1026
EMAIL_USE_TLS = True
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_FILE_PATH = os.path.join(BASE_DIR, 'apps', 'emails')
The ProtonMail Bridge says the email port should be 1025. I attached a screenshot of my SMTP settings.