Report this

What is the reason for this report?

testing php mail function

Posted on January 27, 2015

I have installed sendmail and trying to use a basic mail function in a php page that works on another server.

Have tried a few command line test emails that both worked fine. Successful tests:


that worked, then I tried...

echo "this is email body"|mail -s "This is email subject" peter@myemail.com

which also worked fine

However, the PHP mail function is dead. The only thing I’ve come across that seemed odd were some error message during the sendmail install process:

Creating /etc/mail/sendmail.cf...
*** ERROR: FEATURE() should be before MAILER()
*** MAILER(`local') must appear after FEATURE(`always_add_domain')*** ERROR: FEATURE() should be before MAILER()
*** MAILER(`local') must appear after FEATURE(`allmasquerade')*** ERROR: FEATURE() should be before MAILER()
 
Creating /etc/mail/submit.cf...
Informational: confCR_FILE file empty: /etc/mail/relay-domains
Informational: confCT_FILE file empty: /etc/mail/trusted-users
Updating /etc/mail/access...
Updating /etc/mail/aliases...
/etc/mail/aliases: 1 aliases, longest 4 bytes, 14 bytes total
 
Warning: These messages were issued while creating sendmail.cf
	make sure they are benign before starting sendmail!
 
Errors in generating sendmail.cf
*** ERROR: FEATURE() should be before MAILER()
*** MAILER(`local') must appear after FEATURE(`always_add_domain')*** ERROR: FEATURE() should be before MAILER()
*** MAILER(`local') must appear after FEATURE(`allmasquerade')*** ERROR: FEATURE() should be before MAILER()

Any ideas? I’ve googled ‘test php mail function’ and read through numerous posts but nothing seemed to work or fit with my context… Ubuntu 14/Nginx/PHP.



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!

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.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.