We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32025
    • 305 Posts
    Dayton Web Design Reply #1, 7 years ago
    My FormIt contact form just stopped sending mails after I tweaked the form (but maybe before I am not sure). I tested 4 different e-mail accounts and no e-mails are being sent. I did make some changes to the form before we noticed it wasn't working so I am not sure if its a form processing issue or the server blocked sending a little bit previously. It was working a month before this as I tested it.

    Would someone please check out my form to see if there are an noticeable errors:

    [[!FormIt?
    &hooks=`recaptcha,spam,email,redirect`
    &emailSubject=`Class Registration Form`
    &submitVar=`go`
    &emailTpl=`MyEmail` 
    &emailTo=`[email protected]` 
    &redirectTo=`56` 
    &validate=`name:required, 
    	phone:required,
            email:email:required, 
            class:required:minLength=`1`,
    	    membership:required:minLength=`1`,
    	text:required:stripTags`
    &recaptchaTheme=`white`
    ]]
    
    
    [[!+fi.error.error_message:notempty=`
    <p>[[!+fi.error.error_message]]</p>
    `]]
    <form class="form" action="[[~[[*id]]]]" enctype="application/x-www-form-urlencoded" method="post">
    	<input name="nospam:blank" type="hidden" /><label for="name">Name:
    	<font color="#FF0000"><span class="error">[[+fi.error.name]]</span></font> </label>
    	<input id="name" name="name" type="text" value="[[+fi.name]]" /><br />
    	<br />
            <label for="phone">Phone Number: <font color="#FF0000"><span class="error">[[+fi.error.phone]]</span></font>
    	</label><input id="phone" name="phone" type="text" value="[[+fi.phone]]" /><br />
    	<br />
    	<label for="email">Email: <font color="#FF0000"><span class="error">[[+fi.error.email]]</span></font>
    	</label><input id="email" name="email" type="text" value="[[+fi.email]]" /><br />
    	<br />
    	<label for="class">Class: <font color="#FF0000"><span class="error">[[!+fi.error.class]]</span></font>
    	</label>
    	<select name="class" value="[[!+fi.class]]">
    	<option value="" [[!+fi.class:FormItIsSelected=``]]>Please select ...</option>
    	<option value="Certified Supply Chain Professional" [[!+fi.class:FormItIsSelected=`Certified Supply Chain Professional`]] >Certified Supply Chain Professional (Date: 4-19-2017)</option>
    	<option value="Certified Supply Chain Professional and Exam Fee" [[!+fi.class:FormItIsSelected=`Certified Supply Chain Professional and Exam Fee`]] >Certified Supply Chain Professional and Exam Fee (Date: 4-19-2017)</option>
    	<option value="Basics of Supply Chain Management" [[!+fi.class:FormItIsSelected=`Basics of Supply Chain Management`]] >Basics of Supply Chain Management (Date: 4-20-2017)</option>
    	<option value="Basics of Supply Chain Management and Exam Fee" [[!+fi.class:FormItIsSelected=`Basics of Supply Chain Management and Exam Fee`]] >Basics of Supply Chain Management and Exam Fee (Date: 4-20-2017)</option>
    	</select>
    	<br /><br />
    	<label for="membership">Are you a member? <font color="#FF0000"><span class="error">[[!+fi.error.membership]]</span></font>
    	</label>
    	<select name="membership" value="[[!+fi.membership]]">
    	<option value="" [[!+fi.membership:FormItIsSelected=``]]>Please select ...</option>
    	<option value="Member" [[!+fi.membership:FormItIsSelected=`Search Engine`]] >Member</option>
    	<option value="Non-Member" [[!+fi.membership:FormItIsSelected=`Social Media`]] >Non-member</option>
    	</select>
    	<br /><br />
            <label for="membernumb">Membership Number (If Member): <font color="#FF0000"></font>
    	</label><input id="membernumb" name="membernumb" type="text" value="[[+fi.membernumb]]" /><br />
        <br />
    	<label for="text">Your Mailing Address: <font color="#FF0000"><span class="error">[[+fi.error.text]]</span></font>
    	</label><textarea id="text" cols="55" rows="7" name="text">[[+fi.text]]</textarea><br /><br />
    	<br class="clear" />
            <label>Enter SPAM Code:</label>
    		[[!+formit.recaptcha_html]] <span class="error"> [[!+fi.error.recaptcha]] </span>
            <label>You may click the circular arrows above (Get a new challenge) to load another image that's much easier to read.</label><br class="clear" />
    	<br />
    	<div class="form-buttons">
    		<input type="submit" name="go" value="Send Contact Inquiry" /> </div>
    </form>


    After submission the form does redirect to my success page. One of my fields are called class but I am fairly sure this was working previously for a at least few submissions. Not sure if I need to set up SMTP and if so for which account. These e-mails are being sent to third party e-mail addresses. [ed. note: wbbuilder last edited this post 7 years ago.]
      Making the web a better place on site at a time! Dayton Web Design: http://www.dayton-web-design.com/
      • 17301
      • 932 Posts
      May be worth posting up your tpl too.

      Out of curiosity does it work if you take out the validation?

      &validate=`name:required, 
      phone:required,
      email:email:required, 
      class:required:minLength=`1`,
      membership:required:minLength=`1`,
      text:required:stripTags`


      I suspect that the extra backticks '`' may be causing the validation statement to end and then start again.
        ■ email: [email protected] | ■ website: https://alienbuild.uk

        The greatest compliment you can give back to us, is to spend a few seconds leaving a rating at our trustpilot: https://uk.trustpilot.com/review/alienbuild.uk about the service we provided. We always drop mention of services offered by businesses we've worked with in the past to those of interest.
        • 32025
        • 305 Posts
        Dayton Web Design Reply #3, 7 years ago
        Quote from: lkfranklin at Mar 21, 2017, 12:24 PM
        May be worth posting up your tpl too.

        Out of curiosity does it work if you take out the validation?

        &validate=`name:required, 
        phone:required,
        email:email:required, 
        class:required:minLength=`1`,
        membership:required:minLength=`1`,
        text:required:stripTags`


        I suspect that the extra backticks '`' may be causing the validation statement to end and then start again.


        When you say TPL do you mean MyEmail chunk? If so here it is:

        Name: [[+name]]<br />
        Phone Number: [[+phone]]<br />
        E-Mail: ([[+email]])<br />
        <br /><br /> 
        Class: [[+class]]<br />
        Are you a member? [[+membership]]<br />
        Membership Number (If Member): [[+membernumb]]<br />
        Mailing Address: [[+text]]
        <br /><br />
        ---------------------------------<br />
        * This message was sent from the contact form


        OK so I did some more testing, this time with other e-mail addresses hosted on this same server. Now the tests properly sent twice once with with and the other without the validation you asked me to remove to test. Both of these times the e-mails went through.

        I have a reseller hosting account and this clients account and the e-mails that just properly received are on the same server (different domain names and accounts). So now I am guessing my server might blocking the ability to send to free e-mail accounts through the server(gmail and AOL which were not receiving). At least without setting up SMTP. Although one of the other account tested was a business account (not hosted on this server) and that account also did not receive any submissions. My reasoning for this is I was recently having issues on a a few of my Wordpress sendmail installations as well.

        Maybe I am wrong here but again I just received 2 e-mails when the form e-mail address was hosted on my same server. But I do not receive when I send to: AOL, Gmail, or one other third party company server.

          Making the web a better place on site at a time! Dayton Web Design: http://www.dayton-web-design.com/
          • 37105
          • 194 Posts
          I had some common problems while ago and I could solve this issue by adding &emailToName option to the snippet call.
            Codeplaza Webdesign: for professional websites at low cost
            • 32025
            • 305 Posts
            Dayton Web Design Reply #5, 7 years ago
            Problem solved: I just created a new e-mail account from their own domain name. Then I set up a forwarded on this business e-mail to be sent to the AOL account I want it to go to. The client has to see a forwarded address but it seems to work properly at least.

            It seems like servers (at least mine) really does not want e-mails from a contact form to be sent to a free e-mail address anymore. This is taking away my flexibility as many clients don't always want to be forced to use a professional account. Rant over smiley

            Thank you for your help LK.
              Making the web a better place on site at a time! Dayton Web Design: http://www.dayton-web-design.com/
              • 32025
              • 305 Posts
              Dayton Web Design Reply #6, 7 years ago
              Quote from: donquicky at Mar 21, 2017, 01:22 PM
              I had some common problems while ago and I could solve this issue by adding &emailToName option to the snippet call.

              If you are talking about adding this directly to the snippet area, that would be out of my expertise as I do not know PHP coding. I sometimes can manage to tweak a bit but wouldn't know where to add this definition.
                Making the web a better place on site at a time! Dayton Web Design: http://www.dayton-web-design.com/
                • 37105
                • 194 Posts
                Quote from: wbbuilder at Mar 21, 2017, 01:29 PM
                Quote from: donquicky at Mar 21, 2017, 01:22 PM
                I had some common problems while ago and I could solve this issue by adding &emailToName option to the snippet call.

                If you are talking about adding this directly to the snippet area, that would be out of my expertise as I do not know PHP coding. I sometimes can manage to tweak a bit but wouldn't know where to add this definition.

                No, just add it as option to the FormIt call this:

                [[!FormIt?
                &hooks=`recaptcha,spam,email,redirect`
                &emailSubject=`Class Registration Form`
                &submitVar=`go`
                &emailTpl=`MyEmail` 
                &emailTo=`[email protected]`
                &emailToName=`some name like: Mister Quick` 
                &redirectTo=`56` 
                &validate=`name:required, 
                    phone:required,
                        email:email:required, 
                        class:required:minLength=`1`,
                        membership:required:minLength=`1`,
                    text:required:stripTags`
                &recaptchaTheme=`white`
                ]]
                  Codeplaza Webdesign: for professional websites at low cost
                  • 17301
                  • 932 Posts
                  It sounds like a server error rather than anything to do with MODX/Formit. I reguarly have sites sending to all kinds of emails without problems. I'd suggest checking MX/SPF records and as suggested above including email from emails and name parameters can stop things getting flagged as spam by clients.
                    ■ email: [email protected] | ■ website: https://alienbuild.uk

                    The greatest compliment you can give back to us, is to spend a few seconds leaving a rating at our trustpilot: https://uk.trustpilot.com/review/alienbuild.uk about the service we provided. We always drop mention of services offered by businesses we've worked with in the past to those of interest.
                    • 32025
                    • 305 Posts
                    Dayton Web Design Reply #9, 7 years ago
                    Quote from: donquicky at Mar 21, 2017, 01:33 PM

                    No, just add it as option to the FormIt call this:

                    [[!FormIt?
                    &hooks=`recaptcha,spam,email,redirect`
                    &emailSubject=`Class Registration Form`
                    &submitVar=`go`
                    &emailTpl=`MyEmail` 
                    &emailTo=`[email protected]`
                    &emailToName=`some name like: Mister Quick` 
                    &redirectTo=`56` 
                    &validate=`name:required, 
                        phone:required,
                            email:email:required, 
                            class:required:minLength=`1`,
                            membership:required:minLength=`1`,
                        text:required:stripTags`
                    &recaptchaTheme=`white`
                    ]]

                    Oh, I see. Thank you I think it might be wise to add that in the future. Thank you.
                      Making the web a better place on site at a time! Dayton Web Design: http://www.dayton-web-design.com/
                    • If you're having problems with email sending, be sure to check to see what's going on by testing with QuickEmail. It will give you full debug information and the response from the smtp server if one exists. You'll find emails get rejected more often now for no SPF records as well as for improper credentials using GoogleMail. In addition, you may want to use SMTP via MODX rather than rely on PHP or mail protocols directly.
                        Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup magician. BlogTwitterLinkedInGitHub