We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 47721
    • 2 Posts
    I am new to mods and I am having trouble with formit sending e-mails. Can someone please help, I've tried to look at other posts and forums but can't work out what is wrong.

    This is my email settings under system settings. I've tested it with Quick Email and I get successful and an e-mail delivered

    SMTP Authentication: Yes
    SMTP Connection Prefix: tls
    SMTP Hosts: lamech.mikeit.com.au
    SMTP Password: mypass
    SMTP Port: 25
    SMTP User: myusername
    Use SMTP: No

    This is the coding I am using

    [[!FormIt?
       &hooks=`recaptcha,spam,email,redirect`
       &emailTpl=`MyEmailChunk`
       &emailTo=`[email protected]`
       &redirectTo=`34`
       &submitVar=`submit`
       &validate=`name:required,
          email:email:required,
          subject:required,
          text:required:stripTags,
    ]]
    
    <h2>Contact Form</h2>
    <div class="well">
    <form action="[[~[[*id]]]]" method="post">
        <div id="name">
            <label for="name">Name: [[!+fi.error.name:notempty=`<span class="label label-important">This is a required field.</span>`]]</label>
            <div class="controls">
                <input type="text" name="name" value="[[!+fi.name]]" class="input-block-level">
            </div>
        </div>
     
        <div id="email">
            <label for="email">Email: [[!+fi.error.email:notempty=`<span class="label label-important">This is a required field.</span>`]]</label>
            <div class="controls">
                <input type="text" name="email" value="[[!+fi.email]]" class="input-block-level">
            </div>
        </div>
     
        <div id="comment">
            <label for="comment">Comment: [[!+fi.error.comment:notempty=`<span class="label label-important">This is a required field.</span>`]]</label>
            <div class="controls">
                <textarea name="comment" cols="30" rows="10" value="[[!+fi.comment]]" class="input-block-level"></textarea>
            </div>
        </div>
     
        <input type="submit" value="Submit" class="btn btn-primary">
    	
    </form>
     
    </div>


    Does formit only work if I have Use smtp as YES?
      • 3749
      • 24,544 Posts
      If QuickEmail works with the 'use SMTP' System Setting off, FormIt should too. The first thing to try is removing the recaptcha and spam hooks. If something goes wrong in one of them, the email won't be sent. If it still doesn't work, then you know there's something wrong with the way you've set up the email.
        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
        • 47721
        • 2 Posts
        Thanks Bob, I removed them and still not working. When I change the mail settings in System Settings to gmail, and run Quick Email I get an email from my other account. Could there be something else in the settings I missing out on?
          • 3749
          • 24,544 Posts
          I'm not sure I understand. Does QuickEmail work with the SMTP System Setting off? Many hosts disable the mail() function so that mail doesn't get sent unless you use SMTP or a third-party mail service.

          I generally use SMTP just because it's easier to get it working.
            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