Mails not send from WordPRess

I have verified that postfix is installed and that I can successfully send emails using echo test | mail, and the email arrives as it should.

However, when I try to send an email from WordPress (Contact form 7, or Test Email plugin, the emails do not arrive.

The problem seems to be with the rejection of the domain of the sender address by, where the sender address is www-data@WP-NewBase-052814.

The domain WP-NewBase-052814 doesn’t exist, and this is why rejects it.

But how can I control what this Sender address is? My droplet was created from the standard “WordPress-App” disk image from DigitalOcean.

In /var/log/mail.log I see:

Jan 19 08:19:17 energy postfix/pickup[1803]: 99446628B1: uid=33 from=<www-data>

Jan 19 08:19:17 energy postfix/cleanup[1837]: 99446628B1:

Jan 19 08:19:17 energy postfix/qmgr[1804]: 99446628B1: from=www-data@WP-NewBase-052814, size=766, nrcpt=1 (queue active)

Jan 19 08:19:17 energy postfix/smtp[1839]: 99446628B1: host[] said: 450 4.1.8 www-data@WP-NewBase-052814: Sender address rejected: Domain not found (in reply to RCPT TO command)

Jan 19 08:19:17 energy postfix/smtp[1839]: 99446628B1:,[]:25, delay=0.32, delays=0.05/0.03/0.2/0.04, dsn=4.1.8, status=deferred (host[] said: 450 4.1.8 www-data@WP-NewBase-052814: Sender address rejected: Domain not found (in reply to RCPT TO command))

Show comments

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hello all,

What I could suggest here is using an SMTP plugin for your WordPress site.

That way you will be able to specify an SMTP server with authentication which your emails would be going through. You could for example use SendGrid’s SMTP service. This would drastically increase the delivery rate of your emails as well compared to using plain PHP mail.

I’ve been using this plugin for a while now and it works very well: Easy WP SMTP.

Hope that this helps! Regards, Alex

Try sudo nano /etc/postfix/ and look for the line ‘myhostname’. change ‘WP-NewBase-052814’ to your hostname and then do the same in the line ‘mydomains’. This worked for me. `