Django SSL error during send_mail() while explicitly using TLS

I'm trying to perform a send_mail() call in my Django application, but the mails are not sending. Checking the logs, I see the following error:

[Thu May 29 09:35:20.097725 2025] [wsgi:error] [pid 793757:tid 140153008285440] [remote {ip.ad.dr.ess}:65062] Error sending email: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate (_ssl.c:1147)

My smtp relay uses TLS w/ whitelisting, not SSL, and I've reflected that in my /project/settings/base.py file by setting EMAIL_USE_TLS = True.

I've checked my certificate and it's up-to-date and my website's HTTPS is functional.

I don't understand where the disconnect lies - why could an SSL error be preventing my email from sending when I'm using TLS?

Вернуться на верх