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.

PHP mail() email protocol not working

September 29, 2008 9:46am

Subscribe [3]
  • #16 / Sep 30, 2008 11:13am

    Robin Sowell

    13255 posts

    Thanks, elemental.  OK- can you try one more hacky thing for me.  Flip the conditional back to the way it was originally.  Then- we want to put a space after the -f a la:

    if ( ! mail($this->recipients, $this->subject, $this->finalbody, $this->header_str, "-f ".$this->clean_email($this->headers['From'])))

    See- only change was “-f”. changed to “-f “.

    Then giver her a try and let me know if you can send from ‘Communicate’.

    Make sense?

  • #17 / Sep 30, 2008 12:03pm

    elemental

    77 posts

    Hi Robin, thanks for getting back.

    Unfortunately it does NOT work. Gives the same error msg as before:

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

  • #18 / Oct 01, 2008 11:36am

    Robin Sowell

    13255 posts

    OK- think this needs to be tweaked on the host side of things.  Ask your host if the sendmail_path in your environment could be changed to just ‘/usr/sbin/sendmail -t -i’.  Let them know your PHP application needs to be allowed to set its own envelope sender.

    Hopefully, they will take care of it.  If not, could poke them for an htaccess/ini_set() override.  But first option is the best option.  And no hacking on our end.

    Make sense?

  • #19 / Oct 02, 2008 4:14am

    elemental

    77 posts

    Thanks for the suggestion, I will ask them and let you know how it went.
    Thanks Robin

  • #20 / Oct 02, 2008 10:29am

    Robin Sowell

    13255 posts

    Sounds good.  Hopefully the host will come through w/the change.

  • #21 / Nov 09, 2008 9:29pm

    studioamk

    18 posts

    Hm.  OK- want to just test something and see if it matters?  In system/core/core.email.php around line 1190 you’ll spot where EE actually sends via mail:

    Let’s just flip that safemode conditional and try it once.  See what happens.  So

    ($this->safe_mode == TRUE)
    change to
    ($this->safe_mode != TRUE)

    We’ll force it to use the first option, which is similar to the pure php test.

    Hi all,

    I’m having the exact problem.
    I could send email using php script written inside ee template.
    But, not from ee system.
    I tried Rohin’s hack, but did not work for me.

    Everything was ok, before upgrading to 1.6.5 Build: 20081024.
    So, I would like to know how can I debug the following line…

    mail($this->recipients, $this->subject, $this->finalbody, $this->header_str)
  • #22 / Nov 10, 2008 1:17pm

    Lisa Wess

    20502 posts

    Hey elemental - any updates on this? Been a bit, want to see if you need any more help. =)

  • #23 / Nov 29, 2008 5:52pm

    studioamk

    18 posts

    I’ve found the solution for this.
    It’s because of PHP error under Windows server.

    Here’s the solution for this problem.

    Good luck all!

  • #24 / Dec 01, 2008 4:34pm

    Ingmar

    29245 posts

    Thanks for letting us know. @elemental, what’s your status? Do you still require assistance?

  • #25 / Dec 03, 2008 11:27am

    elemental

    77 posts

    Thanks Ingmar for checking in. Seems I was not subscribed to this thread, or I have unsubscribed by error, anyway here is the update status.

    After asking the hosting provider to change the appropriate settings in PHP.ini they finally came with the SMTP offer. After a few hiccups we are set and all outgoing mail is being sent OK. So unfortunately I cannot tell if that last suggestion would work we are set OK.

    Thank you very much for your help Robin and Ingmar.

  • #26 / Dec 03, 2008 11:45am

    Ingmar

    29245 posts

    Well, the important things is it’s working, of course 😊 Don’t hesitate to post again as needed.

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

ExpressionEngine News!

#eecms, #events, #releases