SMTP error (gmail)

Posted January 4, 2020 1.5k views

I try to send an email via smtp but I get an error from nginx Server Error (500).

if I run the site on a local machine, then the letters go away, but the server fails.

result from command netstat -ntlp | grep LISTEN

tcp 0 0* LISTEN 20380/nginx: master
tcp 0 0* LISTEN 2702/systemd-resolv
tcp 0 0* LISTEN 957/sshd
tcp6 0 0 :::22 :::* LISTEN 957/sshd

I set up the server manual which indicated the following settings

I also tried to open the port through the command, but this did not help.
iptables -A OUTPUT -p tcp -d <myIPdroplet> –dport 587 -j ACCEPT

can someone help me with the problem?

1 comment

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.

Submit an Answer
1 answer

Hi @MrWhilter,

Have you actually installed a service to send out mails? If you haven’t, I’ll suggest checking out Postfix, it will be exactly what you need. DigitalOcean have a pretty good article on how to install and configure it to work. I’m providing you with the Ubuntu article however, if you are using Apache there is one for it as well -


by Justin Ellingwood
by Hanif Jetha
Postfix is a popular open-source Mail Transfer Agent (MTA) that can be used to route and deliver email on a Linux system. It is estimated that around 25% of public mail servers on the internet run Postfix. In this guide, we'll teach you how to get up and running quickly using the Postfix mail server.