Saturday, May 19, 2018

Re: SMTPRecipientsRefused: Sender address rejected: not owned by user

The problem you are having is described by the error message.

The email <ad...@mydomain.com> you are using and configured on the settings.py to be the DEFAULT_FROM_EMAIL is not being recognized by the email server. Maybe you lack the configuration of that email address on the email provider?

Either way, on the DEFAULT_FROM_EMAIL you should put a email that your email provider recognizes. If you want, you can use the reply_to attribute so the replies are sent to <ad...@mydomain.com> after the email you have <sup...@mydomain.com> sent the email.

Hope it helps!

On Tuesday, May 15, 2018 at 9:38:48 PM UTC-3, Tom Tanner wrote:
I have a Django app running on a server with uWSGI and nginx. 

In my `local_settings.py` file I have this:

    ###############
    # EMAIL SETUP #
    ###############
    EMAIL_HOST = 'smtp.privateemail.com'
    EMAIL_HOST_USER = 'sup...@mydomain.com'
    EMAIL_HOST_PASSWORD = 'MY EMAIL PASSWORD'
    EMAIL_PORT = 465
    EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
    EMAIL_USE_TLS = True
    
    
    ########################
    # OTHER EMAIL SETTINGS #
    ########################
    ADMIN_EMAIL = "ad...@mydomain.com"
    SUPPORT_EMAIL = "sup...@mydomain.com"
    DEFAULT_FROM_EMAIL = ADMIN_EMAIL
    SERVER_EMAIL = ADMIN_EMAIL

I run `python manage.py runserver` on my local machine in the Django project's virtual environment. I fill out the password reset form at `password_rest/` using the email `my.pe...@gmail.com` and submit it. I get this error.

    SMTPRecipientsRefused: {u'my.p...@gmail.com': (553, '5.7.1 <ad...@mydomain.com>: Sender address rejected: not owned by user sup...@mydomain.com')}

My website's email provider is Namecheap.

Why do I get this error when testing on my local machine? What must I change/add to get rid of it?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/9368f733-dec3-4be0-b946-6a883be041e4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment