We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 51265
    • 32 Posts
    I've noticed over the last couple of days that my very simple form isn't working. Every time I fill it out and press send, I get an error under the email (YOUR EMAIL IS REQUIRED) even though I've added a valid email address.

    Here's the error in the error log: (ERROR @ /index.php) [FormIt] An error occurred while trying to send the email. Could not instantiate mail function.

    It was working fine and I haven't made any changes but all of a sudden, just stopped. Here's my code -

    [[!FormIt?
    &hooks=`spam,email,redirect`
    &emailTpl=`myEmailChunkEng`
    &emailTo=`[email protected]`
    &emailSubject=`my subject`
    &redirectTo=`4`
    &validate=`name:required,
    email:email:required,
    subject:required,
    text:required:stripTags`
    ]]
    [[!+fi.validation_error_message:notempty=`<p>[[!+fi.validation_error_message:notempty=`Your details are required`]]</p>`]]
    <form action="[[~[[*id]]]]" method="post" class="form" class="contact-form">
    <input type="hidden" name="nospam:blank" value="[[+fi.nospam]]" />
    <div class="col-lg-4 col-sm-4">
    <label for="name"><span class="error">[[!+fi.error.name:notempty=`Your name is required`]]</span></label>
    <input type="text" name="name" placeholder="Name" class="form-control input-box" id="name" value="[[!+fi.name]]">
    </div>
    <div class="col-lg-4 col-sm-4">
    <label for="email"><span class="error">[[!+fi.error.email:notempty=`Your e-mail is required`]]</span></label>
    <input type="email" name="email" placeholder="E-mail" class="form-control input-box" id="email" value="[[!+fi.email]]">
    </div>
    <div class="col-lg-4 col-sm-4">
    <label for="subject"><span class="error">[[!+fi.error.subject:notempty=`Your subject is required`]]</span></label>
    <input type="text" name="subject" placeholder="Subject" class="form-control input-box" id="subject" value="[[!+fi.subject]]">
    </div>
    <div class="col-lg-12 col-sm-12">
    <label for="text"><span class="error">[[!+fi.error.text:notempty=`Your message is required`]]</span></label>
    <textarea name="text" class="form-control textarea-box" placeholder="Your message" id="text" value="[[!+fi.text]]">[[!+fi.text]]</textarea>
    </div>
    <button class="btn btn-primary" type="submit">Send Message</button>
    </form>

    Any ideas??? I'm quite new to Modx Revolution.
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      First, install and use QuickEmail with debug set to 1 to test your ability to send email.

      http://bobsguides.com/quickemail-snippet-tutorial.html
        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