I am new to Bluehost and Django and I am trying to setup a "password reset via email" function on my Bluehost server with Django. I've tried different combinations on setting the host and port number but for some reason it never worked. So here's what I had: (I am currently only working on my local computer.)
On Bluehost website where I can configure my email account, it lists:
Manual Settings
In settings.py I have the emails configured as: (I will list two combinations and the corresponding error message)
combination 1
DEFAULT_FROM_EMAIL = 'admin@my_host.com'
SERVER_EMAIL = 'admin@my_host.com'
EMAIL_USE_TLS = False
EMAIL_HOST = 'box664.bluehost.com'
EMAIL_HOST_PASSWORD = 'my_email_password'
EMAIL_HOST_USER = 'admin+my_host.com'
EMAIL_PORT = 465
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
error message: Exception Value: Connection unexpectedly closed
combination 2
DEFAULT_FROM_EMAIL = 'admin@my_host.com'
SERVER_EMAIL = 'admin@my_host.com'
EMAIL_USE_TLS = True
EMAIL_HOST = 'mail.my_host.com'
EMAIL_HOST_PASSWORD = 'my_email_password'
EMAIL_HOST_USER = 'admin+my_host.com'
EMAIL_PORT = 26
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
error message: Exception Value: (535, 'Incorrect authentication data')
Could anyone give me some suggestions where I did wrong? Any help is appreciated.
Bluehost supports IMAP / SMTP That means you don't have to use Bluehost webmail interface! You can check your emails using other email programs (like Mailbird, Microsoft Outlook or Mozilla Thunderbird). Using desktop email programs will make you more productive and your email will always be available, even offline.
Sending Emails with the Django ShellWe import the Django send_mail function. Then we import the settings object which contains all the global settings and the per-site settings (those inside the settings.py file). Finally, we pass all the needed arguments to the send_mail function.
django-mailer is a reusable Django app for queuing the sending of email. It works by storing email in the database for later sending.
The following settings:
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_USE_TLS = False
EMAIL_HOST = 'mail.yourdomain.com'
EMAIL_PORT = 587
EMAIL_HOST_USER = '[email protected]'
EMAIL_HOST_PASSWORD = 'password'
DEFAULT_FROM_EMAIL = EMAIL_HOST_USER
worked for me. My django version I tested with is 1.8.8. Bluehost smtp settings details are explained here.
I exactly dunno what the problem is, but I have faced the same problem. I think it has something to do with SMTP/SSL. So what I used this: https://github.com/perenecabuto/django-sendmail-backend
Then I used this configuration in settings.py:
EMAIL_USE_SSL = False
EMAIL_USE_TLS= False
EMAIL_HOST = 'box###.bluehost.com'
EMAIL_PORT = 465
EMAIL_HOST_USER = '[email protected]'
EMAIL_HOST_PASSWORD = 'password'
Hope it helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With