Title: Incorrect Authentication Data
Tags: python;django;django-mailer
Question: I tryng to send email in my django projects.
Here is my settings:-
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'gmail.com'
# EMAIL_USE_TLS = True
EMAIL_USE_SSL = True
EMAIL_PORT = 465
EMAIL_HOST_USER = 'omonroe@example.com'
EMAIL_HOST_PASSWORD = '*******'
I am getting this error
(535, b'Incorrect authentication data')
I turned on less secure app also.
I also tried my cpanel Email. For that my setting was
# EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
# EMAIL_HOST = 'mail.marketage.io'
# EMAIL_PORT = 587
# EMAIL_USE_TLS = True
# # EMAIL_USE_SSL = True
# EMAIL_HOST_USER = 'omonroe@example.com'
# EMAIL_HOST_PASSWORD = '*******'
# DEFAULT_FROM_EMAIL = EMAIL_HOST_USER
For this settings I get the same error. I dont know what causing this issue. But My email was working 4 days ago and it worked just fine. But Suddenly Its not working. I tried to debug my code for that I used Gmail SMTP in my localhost. In Localhost its working completely fine but its not working when I try to send email from live server.
Is there any solution??
Thanks In Advance
Comment: try to read this https://www.nativespace.com/mynative/knowledgebase/61/Error-535---Incorrect-authentication-data.html and i advice you to use this `EMAIL_HOST = "smtp.gmail.com"` where is your web site hosted ?

Comment: alright i do not know it,but try out this answer https://stackoverflow.com/a/61547115/15042684

Comment: I hosted my website in Cpanel @amadousow

Comment: Not working @amadousow



{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 0, 'CommentCount': 4, 'ContentLicense': 'CC BY-SA 4.0', 'CreationDate': '2021:00:11/15/21', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<python><django><django-mailer>', 'Title': 'Incorrect Authentication Data', 'ViewCount': 133, 'id': 69971140, 'user_AboutMe': None, 'user_AccountId': 22728644.0, 'user_DisplayName': 'itna sakib', 'user_Reputation': 39.0, 'user_Views': 11.0, 'user_id': 16891936.0}}