We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 20557
    • 43 Posts
    Hi guys,

    I couldn’t get eForm to send e-mails using the mail function. After running a quick test, I was getting this error:
    Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in D:\ApacheSites\xxxxxxxxx\mail_test.php on line 2

    I then found a description of the error I was having on another website and added:

    ini_set ("sendmail_from","[email protected]");


    To eform.inc.php, which seems to have bypassed the error. However, all contact sent through the form is of-course shown as coming from the one address I set.

    The thing is, I don’t understand how to fix the error properly in eForm. What do I need to do?

    Thanks,
    Matt
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Doesn’t eForm have a &from= parameter?
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 20557
        • 43 Posts
        It does, but using it without the ini_set code still generates the error. However, if I use the ini_set code it seems to override the &from= parameter.
          • 20557
          • 43 Posts
          I spoke to one of the admins at my hosting provder and here is what he had to say:

          You’re missing out a variable which states who the email is from (it’s an RFC 2822 requirement)

          Edit your PHP file and put the following at the top of your script

          ini_set ("SMTP","localhost");
          ini_set ("sendmail_from","[email protected]");

          Is this something I can configure through eForm? Or shall I just manually add the entries to the confg file?

          Thanks,
          Matt