I’m setting up “sendmail” to send emails from my wordpress sites. I want to be able to use PHP mailer. I have tried every tutorial on the net to find and fix the problem. I keep getting “Connection refused by [127.0.0.1]” every time I test it. I have tried disabling the firewall and still did not work.

Tutorials that I tried but did not work:
https://www.digitalocean.com/community/tutorials/understanding-and-implementing-fastcgi-proxying-in-nginx
https://www.digitalocean.com/community/questions/configure-ubuntu-16-04-with-lemp-to-send-emails-for-multiple-websites
https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-postfix-as-a-send-only-smtp-server-on-ubuntu-14-04

Rest of the tutorials or questions do not have answers at all.

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.

×
1 answer

Hi @scottscp911,

Sendmail passes messages submitted by “send via command line sendmail” to local sendmail daemon listening at 127.0.0.1:25. It seems like you haven’t configured it that way. Please try and use the following

To fix, set DAEMON_OPTIONS in your sendmail.mc file. Add listening on 127.0.0.1 or use listening on IPv4 “any”.

In your sendmail.mc add the second DAEMON_OPTIONS listed below.
Recompile sendmail.mc into sendmail.cf and restart (or HUP) sendmail daemon.

DAEMON_OPTIONS(`Port=smtp, Addr=127.0.0.1, Name=MTA-loopback')dnl

Regards,
KDSys

Submit an Answer