ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

unable to send message using email contact form

October 28, 2011 2:12pm

Subscribe [4]
  • #1 / Oct 28, 2011 2:12pm

    WebDawg

    34 posts

    When trying to send an email using the email contact form, I receive a message saying that the message was sent successfully yet the message never arrives. When I attempt to send an email through the control panel “communicate” tab, I receive the following message:

    An Error Was Encountered
    Unable to send email at this time.

    Unable to send email using PHP mail(). Your server might not be configured to send mail using this method.

    I’m running ee version 2.2.2 on an IIS 7 server.

    Could anyone please tell me how to determine and resolve the problem?

    Thanks for your help.

  • #2 / Oct 29, 2011 4:54am

    Mark Bowen

    12637 posts

    Hi WebDawg,

    Could you copy the email_test.php script from system > expressionengine > utilities to the root of your site please and give that a try and see what message you get given.

    Thanks,

    Mark

  • #3 / Nov 01, 2011 8:37am

    WebDawg

    34 posts

    I received the same message:

    An Error Was Encountered
    Unable to send email at this time.

    Unable to send email using PHP mail(). Your server might not be configured to send mail using this method.

  • #4 / Nov 03, 2011 10:56am

    Robin Sowell

    13255 posts

    Thanks WebDawg.  At this point?  It’s probably a good idea to contact your host or your server admin.  That test script operates entirely outside of EE- it’s about as simple a php mail test as you can get- and if it’s failing, it suggests something isn’t allowing mail on the server side.

    So check with your host/admin- you may want to point them to that simple script and ask why it would fail.  And to be specific:

    if ( ! mail($_POST['recipient'], $_POST['subject'], $_POST['message']))
      {
       echo "Error: Unable to send your email";
      }

    That’s how the ‘Unable to send’ message is triggered in that form.  The php mail() function returns false.  The server guys should be able to give us some idea of why that function doesn’t work.  Once the simple test form works?  We can see about getting EE proper working (which it hopefully will once mail() works).

    Make sense what’s going on there?

  • #5 / Nov 03, 2011 12:49pm

    WebDawg

    34 posts

    It does. Thanks for your help. I’ll post again when I know that the server is functioning properly.

  • #6 / Nov 03, 2011 2:09pm

    Robin Sowell

    13255 posts

    Sounds good, WebDawg.  We’ll be here when you’ve got the server issue clarified.

  • #7 / Dec 21, 2011 1:44pm

    the_konstantine

    7 posts

    Hey guys,
    I have a similar problem here.
    However, when i copy the email_test.php into my directory this is what i get:

    Email Test Script

    No PHP errors were encountered, which indicates that PHP correctly attempted to send your email message.

    If you do not receive the email it could be due to one of the following problems:

    Your hosting provider might not permit email to be sent using PHP mail
    The path to Sendmail is incorrect in your server’s PHP ini file
    Your server does not have Sendmail configured correctly.
    The recipient’s email server has spam blocking software which is incorrectly identifying messages send using PHP as spam.

    Unfortunately, I’m running of GoDaddy and i’ve been having quite a few problems with this server already in regards to passing forced query strings, so i’m not surprised.

    Any suggestions of what to do?

    When i used the contact_form for the first time, it did send one email, but it hasn’t been sending anything since then…

  • #8 / Dec 21, 2011 2:18pm

    WebDawg

    34 posts

    I wanted to let you know that our server administrator was able to correct the issue on the server and the form is now functioning properly. Thanks for your help.

  • #9 / Dec 21, 2011 2:19pm

    the_konstantine

    7 posts

    Could you explain what he did?

  • #10 / Dec 22, 2011 8:37pm

    Sean C. Smith

    3818 posts

    WebDawg,

    So you’re all good now?

    the_konstantine, I’m sure if you talk to your server admin they will know what to do.

    Sean

  • #11 / Jan 19, 2012 9:17am

    WebDawg

    34 posts

    I apologize for the delay in my response. We checked the php.ini file, found the [mail function] entry, and made sure the following settings were in place:

    SMTP=localhost
    sendmail_from = string
    smtp_port=25

    We then opened IIS 6.0 Manager and saw that the “Default SMTP Virtual Server” wasn’t started. After starting that service/server, the mail function worked fine.

  • #12 / Jan 19, 2012 9:25am

    Robin Sowell

    13255 posts

    WOOT!  As it were.  Thanks for the confirmation, WebDawg.  And the details- they’ll likely help out someone else searching for an answer in the future.

    Looks like all is well for both of you- anything else comes up, just let us know!

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases