Question

testing php mail function

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.

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.