We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10594
    • 2 Posts
    Quote from: mbrinson at Jul 29, 2008, 05:54 PM

    Is there anything special I have to do in the modx configuration to get e-mail to work? Like set the mail server or something? Some setting in apache?

    I’ve got everything working with eForm, except no e-mail goes out. Everything appears to function fine, but then I check the e-mail account I am sending test e-mails to and nothing.


    I’m a noob to modx (a total of 24 hours now) I had the same problem and after some reading it seems the default Contact Us form doesn’t work. The Form comes with the following Document Content.
    [!eForm? &formid=`ContactForm` &subject=`[+subject+]` &to=`[(email_sender)]` ...

    I couldn’t get my email to work unless I changed [tt]email_sender[/tt] to [tt]emailsender[/tt]. I had a read of the eform code and if no [tt]&to[/tt] field is provided it will default to the email address in the Tools->Configuration->User page. So I removed the [tt]&to=`[(email_sender)]`[/tt] section and it also worked.

    Like I said, I’m new to this so I may have it all wrong, but just removing the [tt]&to=`[(email_sender)]`[/tt] should work, provided you want the messages sent to the address in the config. Alternatively, change the [tt]&to=`[(email_sender)]`[/tt] to [tt]&to=`[email protected]`[/tt].
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Looks like an error in the documentation. The [(...)] tags are taken from the database table system_settings, with a few from the config.inc.php file. The setting in the database is named "emailsender". It’s easy to get it mixed up, since most of these settings are named like "setting_name", but this is a legacy from before MODx even began, and was originally only used for sending manager users their username and password (there was no web user validation capability at that time; that’s one of the extensions MODx added).

      But it’s true that if you don’t have that parameter at all, eForm will use the same setting from the Configuration.
        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
        • 21700
        • 42 Posts
        Hi guys ’n’ gals! I’m sorry to bug you with my question, but I’ve been trying to debug this all day. It might be something tiny and/or stupid. I’ve been working with MODx quite some time ago and started to build another website with it. I just can’t get this to work! The problem is: the snippet call isn’t executed, I just get the call on my page. The system-wide placeholders I use are being nicely filled out. I put this in a chunk or on the page itself. Tried with just the formid, tpl and report lines, but still same issue.

        [!eForm?
         &formid=`[*pagetitle*]`
         &tpl=`eForm-login-tpl`
         &report=`eForm-tpl`
         &from=`[+user.email+]`
         &to=`[email protected]`
         &ccsender=`1`
         &subject=`[+subject+]`
         &allowhtml=`1`
         &submitLimit=`5`
        !]


        The template:eForm-login-tpl chunk:
        <div class="eform">
        	<!--display error msg if any--><p class="error">[+validationmessage+]</p>
        	<form id="[*pagetitle*]" method="post" action="[~[*id*]~]" name="eForm-loggedin-input" enctype="multipart/form-data"/>
        	<label class="eform-label" accesskey="n" for="fullname">Name: </label><input class="eform-textinput" type="text" name="fullname" value="[+user.fullname+]" maxlength="60" eform="Name:string:1:Expected at least two words, please fill out your complete name:#REGEX /\w+\b\w{2,}/i" />
        	<label class="eform-label" accesskey="p" for="product">Product (if applicable): </label><input class="eform-textinput" type="text" name="product" value="" maxlength="30" eform="Product:string:0::" />
        	<label class="eform-label" accesskey="s" for="subject">Subject: </label><input class="eform-textinput" type="text" name="subject" value="" maxlength="30" eform="Subject:string:1:Please enter a subject:"/>
        	<label class="eform-label" for="message">Your Question: </label><textarea class="eform-textarea" rows="5" cols="40" eform="Question:html:1:Please enter a message to send.:"></textarea>	
        	<input type="hidden" name="username" value="Posted by: [+user.username+]" eform="::0::" />
        	<input type="hidden" name="email" value="Email: [+user.email+]" eform="::0::" />
        	<input type="hidden" name="phone" value="Phone nr: [+user.phone+]" eform="::0::" />
        	<input type="hidden" name="mobilephone" value="Mobile Phone: [+user.mobilephone+]" eform="::0::" />
        	<input type="hidden" name="currentlogin" value="User logged in: [+user.thislogin+]" eform="::0::" />
        	<input type="submit" name="submit" value="Send" />
        	</form>
        </div>


        the report template is pretty much empty, just has the line TEST in it. The [+user.email+] etc placeholders are set by a snippet by Scotty Delicious and they do get filled out if I just dump the above HTML code in an empty document.

        The things I tried/checked
        -replace all placeholders currently used for static information.
        -case sensitivity
        -reinstall 1.4.4 from repository
        -tried with only first three rules, to make sure I didn’t mess it up later on..
        -tried with <input type="hidden" name="formid" value="[*id*]" /> as wel as id="[*id*]"
        -call both in as outside a chunk

        Can’t really see what I’m doing wrong here. Thank you in advance!

        noes
          • 7455
          • 2,204 Posts
          did you try to call the snippet all in one line like this:?

          [!eForm? &formid=`[*pagetitle*]` &tpl=`eForm-login-tpl` &report=`eForm-tpl` &from=`[+user.email+]` &to=`[email protected]` &ccsender=`1` &subject=`[+subject+]` &allowhtml=`1` &submitLimit=`5`!]
          


          no line breaks a snippet needs to be called in one solid line no breaks.

          Dimmy
            follow me on twitter: @dimmy01
            • 21700
            • 42 Posts
            Dimmy, bedankt! I was unaware of that fact. Now my snippetcall is executed, but I still get an error (see below). It doesn’t get executed in a chunk. A chunk should be able to contain a snippetcall, right?

            [tt]Parse error: syntax error, unexpected ’(’, expecting T_VARIABLE or ’$’ in /home/mydomain/domains/mydomain.nl/public_html/cms/manager/includes/document.parser.class.inc.php(769) : eval()’d code on line 44[/tt]

            I can use placeholders in a snippetcall, right? And I couldn’t find anything triggering this error, does anyone have an idea?

            Thank you,
            noes
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              Check your snippet on line 44, it’s got an error.
                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
                • 21700
                • 42 Posts
                Thank you Susan, I never knew I could interpret the error that way. I found what was the reason for the error: everytime I saved the snippet, the bcc rule gets appended with another "anti-spam()" function. I don’t have a clue where this is coming from, but #’ing the line did the trick!

                The end result after a few times saving the snippet:
                bcc => isset($bcc)? $(anti-spam-(anti-spam-(anti-spam-(anti-spam-(anti-spam-(anti-spam-(anti-spam-bcc:))))))):"",

                Weirdest thing, but it’s up and running! Never intended to send a BCC to anyone using this form anyway smiley

                Again: thanks!
                noes
                  • 16885
                  • 255 Posts
                  I’m not sure if it’s intended behavior or a bug, but the &jScript parameter doesn’t accept chunks, only a link to a JS file, while the docs seem to mention that it behaves similar to &cssStyle, perhaps you could clarify (or fix?) that in a next version.
                    • 30223
                    • 1,010 Posts
                    Works for me... What’s your snippet call and the chunk(s)?

                    Scrap that.... When using a comma delimeted list of chunks it does indeed not work... I’d say this is a bug indeed. I’ll look into it right now.

                    Ok, fixed this I think... Please head over to the repository and download the latest release http://modxcms.com/eForm-1003.html It contains a few other fixes as well.
                      • 18253
                      • 34 Posts
                      Quote from: sottwell at Jul 30, 2008, 12:57 AM

                      Are you sending to the same address in both cases? I had one host that blocked outgoing email using the PHP mail() function to all but internal addresses (sending to my own email on the same server that the site was on).

                      This was an issue with my install and I also noticed a few typos on the eForm Example instructions that had me going a little crazy for a bit.

                      1) Be careful for typos (case sensitivity) On I:\MODx\eForm_1.4.4.5\eform\docs\eform_examples.htm for example:

                      The Thank you message
                      The same recipe... another chunk, called ’eFeedBackThanks’ this time

                      is not the same as the snippet example:

                      &thankyou=`eFeedbackThanks` Note that the B in Back is lowercase on the snippet example. This will give you an error that your document or chunk is not found.

                      2) Be careful for typos within the provided template (chunk) examples:

                      On the:

                      The HTML Form Template
                      For this example we will create a chunk called ’eFeedBackForm’ and copy and paste the following form ...

                      The code reads:


                      <p><label accesskey="n" for="Name">Your Name</label>
                      <input type="text" name="Name" maxlength="60" eform="Your Name::1:Expected at least two words:#REGEX /^\w+\s\w+/i" /></p>

                      Whereas if "Name" is upper case, the N.... it will cause your report to omit the name field because it does not match lowercase [+name+] specified within the placeholder.

                      These are just a couple things I had to find and figure out while installing. Good training though because it helped understand how things work. Sometimes I wonder if these are left intentionally or not. jajajjaj.. Thanks for an awesome snippet !!


                      This discussion is closed to further replies. Keep calm and carry on.