sending mails

29 views
Skip to first unread message

Rey Ondiyo

unread,
Jan 5, 2022, 8:53:28 AM1/5/22
to Django users
Hello
i'm sending mails, I use a mail configured via cpanel, in my django application but i have this mistake 

ConnectionRefusedError at / register
[WinError 10061] No connection could be made because the target computer expressly refused it

My settings.py files

EMAIL_BACKEND ='django.core.mail.backends.smtp.EmailBackend'
EMAIL_USE_TLS = True
EMAIL_HOST = 'mail.toto.net'
EMAIL_HOST_USER = 'in...@toto.net'
EMAIL_HOST_PASSWORD = '***********'
EMAIL_PORT = 465

My views.py files is like this :

message=str(randint(000000, 999999))

                   
emailSend = EmailMessage('CODE DE VALIDATION', message, to=[email])
emailSend.send()
Thanks

Kasper Laudrup

unread,
Jan 5, 2022, 2:01:28 PM1/5/22
to django...@googlegroups.com
On 05/01/2022 14.16, Rey Ondiyo wrote:
> Hello
> i'm sending mails, I use a mail configured via cpanel, in my django
> application but i have this mistake
>
> ConnectionRefusedError at / register
> [WinError 10061] No connection could be made because the target computer
> expressly refused it
>

I have no problem connecting to mail.toto.net on port 465 so I suggest
you start by disabling any software firewalls or whatever similar crap
you might have installed.

No idea what it means to have your mail configured via cpanel though.

Kind regards,

Kasper Laudrup
OpenPGP_0xE5D9CAC64AAA55EB.asc
OpenPGP_signature
Reply all
Reply to author
Forward
0 new messages