Server Error 500, when sending mail

I’m using Django’s smtp backend to send emails and it works on my local system with DEBUG set to false but fails to work on GoDaddy’s servers… I get the Server Error 500 problem and it points towards:-

ConnectionRefusedError at /contact/
[Errno 111] Connection refused
Request Method:	POST
Request URL:	https://www.placeholder.com/contact/
Django Version:	3.2.7
Exception Type:	ConnectionRefusedError
Exception Value:	
[Errno 111] Connection refused
Exception Location:	/opt/alt/python37/lib64/python3.7/socket.py, line 716, in create_connection
Python Executable:	/home/jnb3o6uaake2/virtualenv/APT/3.7/bin/python3.7_bin
Python Version:	3.7.11
Python Path:	
['/home/jnb3o6uaake2/APT',
 '/opt/cpanel/ea-ruby24/root/usr/share/passenger/helper-scripts',
 '/home/jnb3o6uaake2/virtualenv/APT/3.7/lib64/python37.zip',
 '/home/jnb3o6uaake2/virtualenv/APT/3.7/lib64/python3.7',
 '/home/jnb3o6uaake2/virtualenv/APT/3.7/lib64/python3.7/lib-dynload',
 '/opt/alt/python37/lib64/python3.7',
 '/opt/alt/python37/lib/python3.7',
 '/home/jnb3o6uaake2/virtualenv/APT/3.7/lib/python3.7/site-packages']
Server time:	Tue, 21 Sep 2021 12:59:08 +0000

        send_mail(subject=subject, message=message,from_email="placeholder@placeholder.com", recipient_list=["placeholder@placeholder.com"] …
▼ Local vars
Variable	Value
__class__	
<class 'core.views.ContactPageView'>
body	
{'Email': 'Email: placeholder@gmail.com',
 'Message': '1',
 'Name': 'Name: 12',
 'Phone': 'Phone: placeholder'}
form	
<ContactForm bound=True, valid=True, fields=(name;company;phone;email;message)>
message	
'Name: 12\nEmail: placeholder\nPhone: placeholder\n1'
self	
<core.views.ContactPageView object at 0x2b04035e45d0>
subject	
'Website Inquiry'

The sendmail function is highlighted.

EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend"
EMAIL_HOST = 'smtp.rediffmailpro.com'
EMAIL_HOST_USER = 'placeholder@placeholder.com'
EMAIL_HOST_PASSWORD = 'placeholder'
EMAIL_USE_SSL = True
EMAIL_PORT = '465'

I think you have misunderstanded the instructions of Godaddy. You are pointing to www.placeholder.com, when you have to point to the domain you own is Goddady. You have to change this:

EMAIL_HOST = 'smtp.rediffmailpro.com'
EMAIL_HOST_USER = 'placeholder@placeholder.com'
EMAIL_HOST_PASSWORD = 'placeholder

By the email and password you user in Goddady. By the way, you should use environment variables for this settings.

‘placeholder’ is a disguise for my private information eg. name, domain etc.
I just replaced my information with that

Some service providers block certain outbound ports. You need to check with GoDaddy to verify that port 465 is open for you to use. (Internet email spam is a real problem and ISPs take various steps to try and mitigate / limit it.)

ConnectionRefusedError at /contact/
[Errno 111] Connection refused
Request Method:	POST
Request URL:	https://www.placeholder.com/contact/

Ok, Even so Django is telling you that it can’t connect with https://www.placeholder.com/contact/, Have you review the urls config?

It works on my local system :joy:
I’m using placeholder as a placeholder for my private information so it doesn’t get leaked…

Will look into it ty

You are connecting you development system to the Godaddy server and It Works? but with the same config in Deployment you can’ t reach the page?
Do you use a Firewall?