Error when trying to send email in contact form
I have a Mezzanine project hosted in a droplet using
smtp.gmail.com as the host. I have a contact form that should send me an email when someone wants to inquire about more information. I get a 500 status code from Nginx when trying to send an email.
Here is when the problem occurs. To produce the problem, I go into my admin page in my Mezzanine project. I go to my Pages, and then select my form page called Contact. Inside this contact form page, I have a few options in the email section. In the from address: I put in a valid email. In the send mail to others: part, I put the same email. That way I am notified when someone sends an inquiry. This is how the problem is produced.
When I leave the send mail to others: part empty, the page works correctly. Although, I don’t get a notification. Here are things I’ve tried:
I have run the
python manage.py shell command to attempt sending mail that way, and it does successfully. I have also sent emails correctly when just running on my local machine.
I am assuming there is an issue with my droplets server not allowing outgoing emails? I have run the command:
sudo ufw allow 587 and it still doesn’t allow me to send emails. Does anyone know what else I can do to further troubleshoot this issue?
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.×