We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10470
    • 48 Posts
    I have a field in my form called email which i want to use as the address to send the form to. I have put &to=’[+email+]’ in my eform call, but it does not work. any ideas?

    G.
    • Use backticks (`[+email+]`) instead of single-quotes.
        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
        • 10470
        • 48 Posts
        sorry the typo is just in my post i do have &to=`[+email+]` .

        i am trying to do a send to friend form.. is this not possible with eform?
          • 30223
          • 1,010 Posts
          It certainly is possible... Can you post your form template and snippet call?
            • 10470
            • 48 Posts
            Hi,

            [!eForm? &formid=`friendForm` &subject=`Nkoli Oil and Gas Jobs` &to=`[+email+]` &tpl=`friendForm` &report=`friendReport`  &sendAsHtml='1' &replyto=`[email protected]` &from=`[email protected]`  &gotoid=`9`!]


            [+validationmessage+]
            <form method="post" action="[~[*id*]~]" id="friendForm">
            <fieldset>
            <legend>Personal details</legend>
                  <dl class="details">
            		<dt><label for="email">Email Address <span class="required">*</span></label></dt>
            		<dd><input name="email" id="email"  class="highlighter" type="text" size="30" eform="Email Address:email:1" /></dd>
              </dl>
            </fieldset>
              <input alt="Submit" name="go" class="sendBtn" type="submit" value="submit" id="send2"/>
             </form>
              • 30223
              • 1,010 Posts
              Can’t see anything obvious so quickly... Try removing the &gotoid parameter and add &thankyou=`friendReport` &debug=`2`, then add a [+debug+] place holder to your friendReport chunk.

              If the submit is successful the thankyou page should show the email body and somewhere in the debug printout you should see the mail headers. Check what the To headers says.
                • 10470
                • 48 Posts
                I just get:

                Could not instantiate mail function.


                &to with a normal address sends fine. i am using eForm 1.4.2, the eform call is in a chunk in a template.

                that debug pram is cool!


                Gareth.
                • Using eForm 1.4.4 I am experiencing weird results with a dynamic &from ?? Did the dynamic &to end up getting resolved either? Having troubles with &from=`[+email+]` (dynamic) as we speak sad

                  I get the email, but the from field is blank. If I hard code an email in, that works fine... I’ve tried [.email.] per the docs as well... thoughts?

                  I have another site with eForm 1.4.2 where this is working just fine? What’s up??
                    Mike Reid - www.pixelchutes.com
                    MODx Ambassador / Contributor
                    [Module] MultiMedia Manager / [Module] SiteSearch / [Snippet] DocPassword / [Plugin] EditArea / We support FoxyCart
                    ________________________________
                    Where every pixel matters.
                  • UPDATE:

                    I just moved the snippet/.php file for 1.4.2 from the working copy (alternate server) to the server having issues (was using 1.4.4)

                    However, with 1.4.2 it still does not work? I am using PHP Version 4.4.1 on this box...is the section that replaces &from param placeholders maybe not compatible with PHP Version 4.4.1??

                    PHP Version 5.1.6 is the version where &from=`[+email+]` is working...

                    The snippet call:
                    [!eForm? &automessage=`form_thankyou` &autosender=`[email protected]` &from=`[+email+]` &subject=`Company Email Form` &to=`[email protected]` &replyto=`[+email+] &fromname=`Company name` &formid=`the_form` &report=`form_report` &tpl=`the_form_tpl` &thankyou=`form_thankyou`!]
                    
                      Mike Reid - www.pixelchutes.com
                      MODx Ambassador / Contributor
                      [Module] MultiMedia Manager / [Module] SiteSearch / [Snippet] DocPassword / [Plugin] EditArea / We support FoxyCart
                      ________________________________
                      Where every pixel matters.
                      • 30223
                      • 1,010 Posts
                      Try replacing line 420, 421

                      <?php
                      $from = ($from)? formMerge($from,$fields):"";
                      $fromname = ($from)? formMerge($fromname,$fields):""; //this is wrong anyway I just noticed :)
                      ?>


                      with

                      <?php
                      $from = formMerge($from,$fields);
                      $fromname =  formMerge($fromname,$fields);
                      ?>