# Error:SMTPSenderRefused at /register

**URL:** <https://forum.djangoproject.com/t/error-smtpsenderrefused-at-register/25510>\
**Category:** Forms & APIs\
**Created:** [November 21, 2023, 12:23pm UTC](https://forum.djangoproject.com/t/error-smtpsenderrefused-at-register/25510 "2023-11-21T12:23:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![MiledAmir](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/miledamir/32/17238_2.png) [@MiledAmir](https://forum.djangoproject.com/u/MiledAmir)\
**Post date:** [November 21, 2023, 12:23pm UTC](https://forum.djangoproject.com/t/error-smtpsenderrefused-at-register/25510/1 "2023-11-21T12:23:27Z")

</div>

Im new to Django and im trying to send an email to user  
i put this in settings.py : EMAIL\_HOST=‘[smtp.gmail.com](http://smtp.gmail.com)’  
EMAIL\_HOST\_USER=‘_**’  
EMAIL\_HOST\_PASSSWORD='**_’  
EMAIL\_PORT= 587  
EMAIL\_USE\_TLS= True  
EMAIL\_BACKEND= ‘django.core.mail.backends.smtp.EmailBackend’  
ALLOWED\_HOSTS =   
and this in views.py in def register :  
send\_mail(  
‘Contact Form’,  
‘Bienvenueeeee a toi’,  
‘settings.EMAIL\_HOST\_USER’,  
[email],  
fail\_silently=True)  
Error:SMTPSenderRefused at /register

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [November 21, 2023, 1:28pm UTC](https://forum.djangoproject.com/t/error-smtpsenderrefused-at-register/25510/2 "2023-11-21T13:28:34Z")

</div>

Many possibilities here.

- Your email host user isn’t correct
- Your email host password isn’t correct
- Your email account doesn’t have “Less secure apps” enabled
- You’re not using an app password for your account
- The email address you’re using as the “from” address isn’t authorized for that account.

I suggest you find a blog post that describes exactly what needs to be done to send emails through gmail using smtp.

What I also suggest you do is write a small-standalone script to use the Python SMTP library to send a test email from the command line. Use that to check your account’s settings and server configuration before setting it up in Django.
