Sending Godaddy email via Django using python
Asked Answered
U

6

8

I have these settings

EMAIL_HOST = 'smtpout.secureserver.net'
EMAIL_HOST_USER = '[email protected]'
EMAIL_HOST_PASSWORD = 'password'
DEFAULT_FROM_EMAIL = '[email protected]'
SERVER_EMAIL = '[email protected]'
EMAIL_PORT = 465
EMAIL_USE_TLS = True
SMTP_SSL = True

Speaking to Godaddy I have found out these are the ports and settings

smtpout.secureserver.net
ssl
465

587
TLS ON

3535
TLS ON

25
TLS ON

80
TLS ON
or
TLS OFF

I have tried all the combinations. If I set TLS to True I am getting

STARTTLS extension not supported by the server.

If I set to 465 I am getting

Connetion Closed

If I set other combinations like

EMAIL_HOST = 'smtpout.secureserver.net'
EMAIL_HOST_USER = '[email protected]'
EMAIL_HOST_PASSWORD = 'password'
DEFAULT_FROM_EMAIL = '[email protected]'
SERVER_EMAIL = '[email protected]'
EMAIL_PORT = 25
EMAIL_USE_TLS = False

Invalid Address

For verification, I used Google Mail settings to test if the email sending via python works, and it is working.

Now I want to switch to GoDaddy and I know for the email we use TLS to log in even for POP3 download and it is working, so I am not sure why python / Django option is not working. Can you please help?

I have called Godaddy, they cannot help because it is a software issue - all their settings and ports are working, so I have no one to ask.

Umpire answered 25/11, 2017 at 5:47 Comment(2)
Not a direct answer, but you can use a free email provider like zoho with your domain and no need to worry about your hosting providers setting. https://mcmap.net/q/1325956/-zoho-smtp-smtpauthenticationerror-at-535-39-authentication-failed-39-django-appNee
Thank you Jose looking into this, I know that is an option, but I am looking for this particular solution and I am sure so many people would like to know the answer.Umpire
S
9

This worked for me with my GoDaddy email. Since GoDaddy sets up your email in Office365, you can use smtp.office365.com.

settings.py

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

method in views.py that handles sending email. The email variable is from a user form.

from django.conf import settings
from django.core.mail import EmailMessage
def send_email(subject, body, email):
    try:
        email_msg = EmailMessage(subject, body, settings.EMAIL_HOST_USER, [settings.EMAIL_HOST_USER], reply_to=[email])
        email_msg.send()
        return "Message sent :)"
    except:
        return "Message failed, try again later :("
Sassaby answered 12/2, 2018 at 15:35 Comment(2)
After trying for sometime, this solution is the only one that worked for me. I wonder if this is a recommended approach though.Tourane
Even Godaddy support couldn't help me out. This worked flawlessly.Johathan
J
1

I found this code worked for me.. Hope this will be useful to somebody.
I was using SMTP godaddy webmail..you can put this code into your django setting file.
Since you cannot set Both SSL and TSL together... if you do so you get the error something as, At one time either SSL or TSL can be true....

setting.py

# Emailing details
EMAIL_HOST = 'md-97.webhostbox.net'
EMAIL_HOST_USER = 'mailer@yourdomain'
EMAIL_HOST_PASSWORD = 'your login password'
EMAIL_PORT = 465
EMAIL_USE_SSL = True
Janinajanine answered 17/10, 2018 at 6:26 Comment(0)
K
1

I managed to decide to access the site https://sso.secureserver.net/?app=emailsetup&realm=pass& It seems that when accessing, you can enable email for external use.

EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtpout.secureserver.net'
EMAIL_HOST_USER='aXXXX@xxxx'
EMAIL_HOST_PASSWORD='AsgGSDAGSasdsagas'
DEFAULT_FROM_EMAIL='aXXXX@xxxx' 
EMAIL_PORT=465
EMAIL_USE_SSL=True 
EMAIL_USE_TLS=False

It worked for me

Knightly answered 14/4, 2020 at 18:37 Comment(0)
P
1

It's been a while but, maybe the answer can help somebody else. I just talked to GoDaddy about the issue and the needed configration they told me was like,

EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtpout.secureserver.net'
EMAIL_HOST_USER = env('EMAIL_HOST_USER')
DEFAULT_FROM_EMAIL = EMAIL_HOST_USER
SERVER_EMAIL = EMAIL_HOST_USER
EMAIL_HOST_PASSWORD = env('EMAIL_HOST_PASSWORD')
EMAIL_PORT = 80
EMAIL_USE_SSL = False
EMAIL_USE_TLS = True

these are the django config settings but, I'm sure that it can be copied to other platforms.

Also, the email dns configration they provided was,

email dns config

Pepito answered 20/1, 2021 at 13:54 Comment(0)
C
1

use 'smtpout.asia.secureserver.net' as EMAIL_HOST in Django settings.py. you can refer to the GoDaddy email help page link.

https://in.godaddy.com/help/mail-server-addresses-and-ports-for-business-email-24071

Congressman answered 24/6, 2022 at 10:4 Comment(1)
While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From ReviewTonicity
P
0

In my case, this way work for me:

#settings.py

EMAIL_BACKEND='django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST='smtpout.secureserver.net'
EMAIL_PORT=465
EMAIL_USE_SSL=True
EMAIL_USE_TLS=False
EMAIL_HOST_USER='your@domain'
EMAIL_HOST_PASSWORD='yourpass'
ADMIN_EMAIL='your@domain'
Patrimony answered 30/7, 2022 at 20:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.