We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 27672
    • 168 Posts
    slush puppie Reply #1, 13 years ago
    i’ve used FormIt several times, and it’s worked great. now i’m trying to get it to work on this new site and the processing/validation works fine, but the emails are not coming through.
    [[!FormIt?
       &hooks=`spam,email,redirect`
       &emailTpl=`MyEmailChunk`
       &emailTo=`[email protected]`
       &redirectTo=`19`
       &validate=`name:required,
          email:email:required,
          subject:required,
          text:required:stripTags`
    ]]
    (yes i have my email address plugged in correctly in `emailTo`, just edited for posting)
    
    <h2>Contact Form</h2>
     
    [[!+fi.error_message:notempty=`<p>[[!+fi.error_message]]</p>`]]
     
    <form action="[[~[[*id]]]]" method="post" class="form">
        <input type="hidden" name="nospam:blank" value="" />
     
        <label for="name">
            Name:
            <span class="error">[[!+fi.error.name]]</span>
        </label>
        <input type="text" name="name" id="name" value="[[!+fi.name]]" />
     
        <label for="email">
            Email:
            <span class="error">[[!+fi.error.email]]</span>
        </label>
        <input type="text" name="email" id="email" value="[[!+fi.email]]" />
     
        <label for="subject">
            Subject:
            <span class="error">[[!+fi.error.subject]]</span>
        </label>
        <input type="text" name="subject" id="subject" value="[[!+fi.subject]]" />
     
        <label for="text">
            Message:
            <span class="error">[[!+fi.error.text]]</span>
        </label>
        <textarea name="text" id="text" cols="55" rows="7" value="[[!+fi.text]]">[[!+fi.text]]</textarea>
     
        <br class="clear" />
     
        <div class="form-buttons">
            <input type="submit" value="Send Contact Inquiry" />
        </div>
    </form>


    ’MyEmailChunk’ chunk:
    <p><strong>[[+name]]</strong> ([[+email]]) ([[+phone]])<br />Wrote: <p>
    <p><strong>Subject</strong>: [[+subject]]</p>
    <p><strong>Message</strong>: [[+text]]</p>


    this example was pulled from the add-ons docs, just trying to get anything to send.

    nothing in the error log, and the script redirects to the success page. modx 2.0.8, PHP Version 5.2.17 - it’s on one of the basic godaddy shared hosting servers. i’ve gotten FormIt to work on these types of sites in the recent past. not sure what i’m screwing up here.

    thanks so much for any assistance!
      • 20358
      • 10 Posts
      Do you have any other plugins setup to email notifications that *are* working (ie. Quip)? You could probably run a quick test just to make sure email is working from MODx by logging out and hitting the "Forgot your Login?" link on the login screen. Just trying to get an idea of how broad or narrow the issue might be.

      Swill


        • 27672
        • 168 Posts
        slush puppie Reply #3, 13 years ago
        good idea. just tried this, and have not received an email yet. when i started trying to get this to work i was on 2.0.7, figured maybe upgrading would help, so it’s now currently at 2.0.8.

        i’m able to get a email to send via php using a snippet like:
        <?php
        //echo (mail('[email protected]', 'Php Mail Test', 'hello')) ? 'mail sent' : 'error sending mail';


        so it does appear it’s a modx problem. nothing appears in the error log after trying to do the forgotten password action.
          • 27672
          • 168 Posts
          slush puppie Reply #4, 13 years ago
          just noticed this caught in my spam filter (@gmail.com address):
          The original message was received at Fri, 13 May 2011 05:44:02 -0700
          from localhost.localdomain [127.0.0.1]
          
            ----- The following addresses had permanent fatal errors -----
          <[email protected]>
             (reason: 553 sorry, your mail was administratively denied. (#5.7.1))
          
            ----- Transcript of session follows -----
          ... while talking to relay-hosting.secureserver.net.:
          >>> MAIL From:<[email protected]> SIZE=1542
          <<< 553 sorry, your mail was administratively denied. (#5.7.1)
          501 5.6.0 Data format error
          
          Final-Recipient: RFC822; [email protected]
          Action: failed
          Status: 5.1.3
          Diagnostic-Code: SMTP; 553 sorry, your mail was administratively denied. (#5.7.1)
          Last-Attempt-Date: Fri, 13 May 2011 05:44:02 -0700
          
          
          ---------- Forwarded message ----------
          From: xxxxxxxxxx xxxxxxxxxx <[email protected]>
          To: Default Admin User <[email protected]>
          Date: Fri, 13 May 2011 05:44:02 -0700
          Subject: Your login details
          Hello admin,
          
          A request for a password reset has been issued for your MODx user. If you sent this, you may follow this link and use this password to login. If you did not send this request, please ignore this email.
          
          Activation Link: http://xxxxxxxxxx.com/manager/?modahsh=43e5731eb23f41d04fdfbcb7c8edbb00
          Username: xxxxxxxxxx
          Password: xxxxxxxxxx
          After you log into the MODx Manager, you can change your password again, if you wish.
          
          Regards,
          Site Administrator


          this was from the forgotten password action in the modx manager. i obviously replaced any personal info with ’xxxxxxxxxx’, but it seems gmail wasn’t liking what modx was emailing out.
            • 20358
            • 10 Posts
            Wow, that is a bit weird. I run my primary admin account through gmail too and tested right before making that earlier suggestion. I got the email just fine (running 2.0.8 also). I also get emails from Quip, but not currently using Formit, so I’m not sure about that one.

            Sounds like your issue is more general though with the way MODx is sending mail. I see you have the forgot password email in your spam filter. Are you able to see if the Formit emails are going there too, or is that to a different email address?

            Swill
              • 27672
              • 168 Posts
              slush puppie Reply #6, 13 years ago
              no, i have not received any of the FormIt emails in my spam filter. only the forgotten password reset.
                • 20358
                • 10 Posts
                Ok, well that at least tells us that mail is being sent from the server sucessfully via other means. I haven’t played with Formit yet, so I just spent the last 15 minutes browsing through the documentation and becoming familiar with hooks. From what I’ve read, it sounds like if any of the hooks you have defined fails, then none of the following hooks will be processed.

                Now, that being said, I believe you stated previously that you are getting to the redirect page? If so, then that leads me to believe that the spam and email hooks are processing successfully (at least on the backend), since redirect is the last hook in you have defined.

                So, assuming that email is at least "reporting" success, it’s possible the mail is getting dumped prior to being sent off of the server. This is where access to the server mail logs would be nice. If your hosting service has a control panel that includes this function, I would highly recommend checking there to see if you can see any test mails even passing through the server’s mail queue.

                One other thing that caught my eye is a missing closing tag in your emailTpl. I’m not sure if this would prevent the whole process from completing successfully, but it might be worth at least checking:

                Top line in your emailTpl containts two open "p" tags, but nothing closing them. I’m guessing a typo on that second one?

                <p><strong>[[+name]]</strong> ([[+email]]) ([[+phone]])<br />Wrote: <p>
                


                I’m also going to install this on my system later today, as it is a function I need to get familiar with for another project anyway. Unless you report back stating that the closing "p" magically fixes this, I’ll make my first order of business picking apart the email hook to see what it’s doing.

                Swill
                  • 3749
                  • 24,544 Posts
                  You can try installing QuickEmail for a quick test of whether MODX is sending mail successfully (and some diagnosis of SMTP issues).

                  Tutorial here: http://bobsguides.com/quickemail-snippet-tutorial.html
                    Did I help you? Buy me a beer
                    Get my Book: MODX:The Official Guide
                    MODX info for everyone: http://bobsguides.com/modx.html
                    My MODX Extras
                    Bob's Guides is now hosted at A2 MODX Hosting
                    • 20358
                    • 10 Posts
                    Oh, QuickEmail looks quite handy. I say give that a shot if closing the "p" tag doesn’t do anything. If anything, you can get a clear idea as to whether it’s a general MODx mailing issue, or if it’s something specific to that email hook in Formit.

                    Swill
                      • 27672
                      • 168 Posts
                      changing the </p> didn’t do anything. that’s just the formatting of the output, so i’m sure it doesn’t validate html in there, doesn’t even need to be html.

                      i’m trying to install quickEmail right now, but getting an error that the package isn’t available for download, will try again later.