We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 52516
    • 1 Posts
    Quote from: BobRay at Jan 14, 2011, 06:37 AM
    I'm glad it worked. Thanks for reporting back. smiley

    Hi,

    [[!FormIt?
    &hooks=`email`
    &emailTpl=`myEmailChunk`
    &emailTo=`[email protected]`
    &validate=`name:required,
    Email:email:required,
    Mobile:required,
    msg:required,
    ]]


    <form method="post" id="contact-form" name="form1" no-validation>
    <input type="text" name="name" placeholder="Name/Company" maxlength="150" value="[[+fi.name]]"/>
    <input type="text" name="email" placeholder="Email" maxlength="150" value="[[+fi.email]]" />
    <input type="text" name="Mobile" placeholder="Contact no." maxlength="150" value="[[+fi.Mobile]]"/>
    <textarea name="msg" cols="50" rows="3" placeholder="Share something with us" value="[[+fi.msg]]"></textarea>
    <div style="padding-top:2%;" class="g-recaptcha" data-sitekey="6LcbtgoTAAAAAN6Lzn_GtuiF3a7Ytl4DYLtEsd52">
    <input type="submit" value="Submit" class="btn-default btn4">
    </form>
    this is my code i am new in modx this code is not working in my site localhost can you help me to solve this
      • 3749
      • 24,544 Posts
      You're missing some FormIt Properties (particularly &subject): https://rtfm.modx.com/extras/revo/formit/formit.hooks/formit.hooks.email.

      That's used for the emailFrom address. Make sure it's an address on your server and that the account exists.

      If it's still not sending, install the QuickEmail extra to help diagnose any problems with the email system.

      Be aware that Gmail silently trashes mail from a number of hosts, so your code might be working fine.
        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
        • 52464
        • 14 Posts
        Hi my friends. I have a similar problem with a contact form as the previous ones described here.
        I have Modx installed in a localhost setting without smtp service, so I'm using Gmail.
        First, I tested with QuickEmail and I had to change the prefix/port combo to 'ssl' and '465'.
        After the change, QuickEmail successfully sent an test email to my Gmail account.

        However, with FormIt I can't send any email using the same settings that I have in System Settings (same Gmail account and smtp settings -- I got that configuration from this thread).

        I followed all the Google directions to allow other apps to access my Gmail account:

        https://www.google.com/settings/u/1/security/lesssecureapps

        https://accounts.google.com/b/0/DisplayUnlockCaptcha

        https://security.google.com/settings/security/activity?hl=en&pli=1

        My code for my contact form is:

        [[!FormIt?
        &hooks=`email`
        &emailTpl=`sentEmailTpl`
        &emailSubject=`Test Message`
        &emailTo=`*****************@gmail.com`
        ]]
        
        <form action="[[~[[*id]]]]" id="contact-form">
                        <input type="text" class="contact-info" id="contact_name" name="contact_name" placeholder="Your name" value="[[+fi.contact_name]]" />
                        <input type="text" class="contact-info" id="email" name="email" placeholder="Your email" value="[[+fi.email]]" />
                        <input type="text" class="contact-info" id="subject" name="subject" placeholder="Subject" value="[[+fi.subject]]" />
                        <textarea class="contact-info" id="message" name="message" rows="10" placeholder="Your message">[[+fi.message]]</textarea>
                        <input type="button" id="clear-fields" value="Clear fields" />
                        <div class="captcha"></div>
                        <input type="submit" id="send-message" value="Send your message" />
        </form>


        Finally, my sentEmailTpl chunk:

        Message from: [[+contact_name]]<br />
        <strong>[[+subject]]</strong><br />
        <p>[[+message]]</p> <br />
        For replying to [[+contact_name]], send an email to <a href="mailto:[[+email]]">[[+email]]</a>


        Thanks a lot for your help!
          • 3749
          • 24,544 Posts
          It may be because Gmail doesn't like localhost for the domain or in the sender's email.

          You may also be falling afoul of Gmail's stringent anti-spam system which often causes email to fail silently.
            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
            • 54869
            • 2 Posts
            Hello sir!
            I need help. i am useing MyEmailChunk. I have a sending issue. please help me. My code is under below.
            [[!FormIt?
               &hooks=`recaptcha,spam,email,redirect`
               &emailTpl=`MyEmailChunk`
               &emailTo=`*********@gmail.com`
               &redirectTo=`[[~[[*id]]]]`
               &validate=`nospam:blank,
                  name:required,
                  email:email:required,
                  subject:required`
            ]]
            
            [[!+fi.validation_error_message:notempty=`<p>[[!+fi.validation_error_message]]</p>`]]
            
            <form action="[[~[[*id]]]]" method="post" class="form">
                <input type="hidden" name="nospam" 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" />
            <!--[[!+formit.recaptcha_html]]-->
            <!--[[!+fi.error.recaptcha]]-->
             
                <br class="clear" />
             
                <div class="form-buttons">
                    <input type="submit" value="Send Contact Inquiry" />
                </div>
            </form>
            
              • 3749
              • 24,544 Posts
              Try the QuickEmail extra to see if your mail system is working at all.

              Since your form looks like a simple contact form, you might also check out the SPForm extra.
                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
                • 54869
                • 2 Posts
                can you guide me please how can i use quickmail??
                  • 3749
                  • 24,544 Posts
                  If you click on this link, it will tell you: QuickEmail.
                    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