Symptom: Contact Form does not send mail, but reports success.

maybe someone has an idea how to proceed. I have a standard contact form that DOES return a thank you (success) message but no email is being send.

I tried both sendmail and PHPmail in the email settings - and when I try to send an email from the tools > communicate form I get errors on both ("Unable to send email using PHP Sendmail/PHP mail")

But if I enable PHP in the template and write a simple piece of PHP:

$to = "[email protected]";
$subject = "Test mail";
$message = "Hello! This is a simple email message.";
$from = "[email protected]";
$headers = "From: $from";
echo "Mail Sent.";

This works. So PHP mail() works. ....

What the heck could be possibly wrong? What do I miss here?

  • I'm not sure why mail() would work and EE's phpmail support wouldn't but sometimes it's easier to switch to an alternative approach rather than debugging a weird issue. Have you tried the SMTP option?
    – Dom Stubbs
    Commented Jan 14, 2013 at 10:53
  • Thanks Dom - thats what I ended up doing. Seems a funky config from the Hoster.
    – Steven
    Commented Jan 23, 2013 at 20:39
  • 1
    I agree with Dom, and my default approach to any outbound email, whether from EE, Freeform or PHP code I've written, is to encourage the client to give me an email address on their server and enable SMTP relay. It removes a dependency on having mail server support configured on your server (using Postfix or other options) and reduces risk that your web server's IP will ever be logged as a source of spam. Better to keep such services on their own servers. Commented Jan 24, 2013 at 16:02

3 Answers 3


Have you considered using Freeform? http://devot-ee.com/add-ons/freeform It is not advised to run PHP inside of your templates for various reasons. You are much better off using an addon to accomplish this.

  • This is not about freeform, forms or including php - this is about emails not being send. - I included the php script only to check if php mail() works. And it does. The question is - Why does EE not send the email? Why does it report success? Why can I send with a php mail() script? Why can I not send with the Communication Tool neither using sendmail nor PHPmail?
    – Steven
    Commented Jan 3, 2013 at 20:44
  • I understand what you're saying but there are more benefits (like CreateSean mentioned below) to using an addon versus running PHP in your templates: security issues, no template caching allowed and more. I'm not sure why what you are trying to do won't work, but it's definitely not the recommended way to run PHP inside of templates. This should really only be used if there is no other course of action to get the desired result. Commented Jan 3, 2013 at 23:48
  • Thanks Mark - as I said: The php was only to test if php mail() would work. I never intended to leave it there. For the very same reasons you mentioned above.
    – Steven
    Commented Jan 24, 2013 at 13:15

I would recommend using FreeForm. The free version will do exactly what you need as well as saving the contact submissions to the database allowing your client to view them within the CP.


I can't say exactly how they do this but the problem was due to a unusual configuration from the Hoster to comply with German anti-spam legislation. The Solution was to use SMTP. I couldn't get any specifics from the Hoster to explain the symptoms.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.