We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 14424
    • 28 Posts
    Hello All,

    I am about to pull my hair out, I need some advice.

    Problem #1: Ok long story short to send email thru a Godaddy website the FROM has to be an email on taht domain. Understand this, worked around it in the past. If you don’t do it you get: <<< 553 sorry, your mail was administratively denied. (#5.7.1)
    501 5.6.0 Data format error . LIKE I said no problem understand this issue.

    Problem #2: All I need formit to do is make the FROM be [email protected] . I am using MODXCMS Revolution 2. So

    A. I have the emailsender field set right (under System-> System Settings)
    B. I set the EMAILFROM in the hook to the right value(see below)

    NO MATTER what I do it is still making the FROM be the email the user types in the form. ANY help would be wonderful!! Thanks-> Joel Logan

    ***************CODE******************************

    [[!FormIt?
    &amp;hooks=`spam,email,redirect`
    &amp;emailTpl=`ContactFormReport`
    &amp;emailFrom=`[email protected]`
    &amp;emailTo=`[email protected]`
    &amp;emailUseFieldForSubject=`1`
    &amp;redirectTo=`15`
    &amp;submitVar=`submitContact`
    ]]
    <p class="error">[[+fi.error.error_message]]</p>
    <form id="EmailForm" action="[[~[[*id]]]]" method="post">
    <input name="nospam:blank" type="hidden" />

    <fieldset>
    <h3>Contact Form</h3>
    <label for="cfName">Your name:
    <span class="invalidValue">[[+fi.error.name]]</span>
    <input id="cfName" class="text" name="name:required" type="text" value="[[+fi.name]]" /> </label>
    <label for="cfEmail">Your Email Address:
    <span class="invalidValue">[[+fi.error.email]]</span>
    <input id="cfEmail" class="text" name="email:required:email" type="text" value="[[+fi.email]]" /> </label>
    <label for="cfRegarding">Regarding:
    <span class="invalidValue">[[+fi.error.regarding]]</span>
    </label>
    <select id="cfRegarding" name="subject">
    <option value="General Inquiries">General Inquiries</option>
    <option value="Press">Press or Interview Request</option>
    <option value="Partnering">Partnering Opportunities</option>
    </select>
    <label for="cfMessage">Message:
    <span class="invalidValue">[[+fi.error.message]]</span>
    <textarea id="cfMessage" cols="20" rows="4" name="message:required:stripTags">[[+fi.message]]</textarea>
    </label>
    <label> </label><input id="cfContact" class="button" name="submitContact" type="submit" value="Send This Message" />
    </fieldset>
    </form>

    • Have you considered using a different SMTP server for sending your mail? You can even use a Gmail account for sending SMTP.
        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
        • 3749
        • 24,544 Posts
        Here’s the relevant code in core/components/formit/model/formit/fihooks.class.inc:

         $emailFrom = empty($fields['email']) ? $this->modx->getOption('emailsender') : $fields['email'];
                if (empty($emailFrom)) {
                    $emailFrom = $this->modx->getOption('emailFrom',$this->formit->config,$emailFrom);
                }


        or, if you’ve updated to the most recent version:

        $emailFrom = empty($fields['email']) ? $this->modx->getOption('emailsender') : $fields['email'];
                if (empty($emailFrom)) {
                    $emailFrom = $this->modx->getOption('emailFrom',$this->formit->config,$emailFrom);
                    $emailFrom = $this->_process($emailFrom,$fields);
                }


        If you replace it with this it should use the System Setting

                    $emailFrom = $this->modx->getOption('emailsender');


        Note that your change might be overwritten if you update FormIt.

        As an alternative, I think you could modfy your email form and change the name of the email field, so $fields[’email’] would not be set. It would use the emailsender value (or the parameter, if set), but then you’d lose the user’s email completely, unless you put [[+fi.xemail]] in the body of the message somewhere.

        <input id="cfEmail" class="text" name="xemail:required:xemail" type="text" value="[[+fi.xemail]]" /> </label>


        Sottwell’s solution may be a better choice, although I think Gmail will reset the emailFrom to your Gmail address, so again, you need to put the user’s email in the message body somewhere.
          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
        • GMail has an option to set your preferred email sender account to an external account.
            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
            • 3749
            • 24,544 Posts
            Quote from: sottwell at Sep 15, 2010, 05:35 AM

            GMail has an option to set your preferred email sender account to an external account.

            I learn something from you almost every day. cool

            I don’t think that option existed the last time I checked.
              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
            • Settings -> Accounts and Import, Send Mail As, and the "Send mail from another address" button. Although I do believe the actual mail headers will indicate that the mail comes from gmail servers; in one case some had problems receiving mail where anyone else was receiving it just fine:
              It was an issue with my host. It apparently had Google Apps blocked or something which is what I use for mail.
                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
                • 14424
                • 28 Posts
                I changed to the code like you said and it worked! Thanks a million! smiley If anybody else reading this uses go daddy remember that the from email address has to be the domain GoDaddy is hosting for you.

                Joel Logan
                  • 31025
                  • 2 Posts
                  I’m making a simple "Contact us" page and it looks I have the same problem: formtit processes request without any error, but emails are not received.

                  I tried to modify sources but it didn’t help. Also, as I see if I will use "&emailFrom" parameters for snippet, I don’t have to set / use "emailsender" global config. I’ve also tried to use gmail or yandex.ru as a smtp server, but the same problem.

                  Maybe I have to make some configuration in modx or/and godaddy hosting? Do I have to use real email address for "emailTo" or just have to use my hosted domain?

                  The sources are: (basically I copied/pasted Formit example)

                  [[!FormIt?
                     &hooks=`spam,email,redirect`
                     &emailTpl=`contactEmail`
                     &emailTo=`[email protected]`
                     &emailFrom=`[email protected]`
                     &emailReplyTo=`[email protected]`
                     &redirectTo=`1`
                     &validate=`name:required`
                  ]]
                  
                  <h2>Contact Form</h2>
                  
                  <p>[[+fi.error.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>
                  
                  
                      <label>
                          Numbers:[[+fi.error.numbers]]
                          <select name="numbers" value="[[+fi.numbers]]">
                              <option value="">Select an option...</option>
                              <option value="one" [[!+fi.numbers:FormItIsSelected=`one`]]>One</option>
                              <option value="two" [[!+fi.numbers:FormItIsSelected=`two`]]>Two</option>
                              <option value="three" [[!+fi.numbers:FormItIsSelected=`three`]]>Three</option>
                          </select>
                      </label>
                  
                      <label>
                          Colors:[[+fi.error.colors]]
                          <input type="hidden" name="colors[]" value="" />
                      </label>
                      <ul>
                        <li>
                          <label><input type="checkbox" name="colors[]" value="red" [[!+fi.colors:FormItIsChecked=`red`]] /> Red</label>
                        </li>
                        <li>
                          <label><input type="checkbox" name="colors[]" value="blue" [[!+fi.colors:FormItIsChecked=`blue`]] /> Blue</label>
                        </li>
                        <li>
                          <label><input type="checkbox" name="colors[]" value="green" [[!+fi.colors:FormItIsChecked=`green`]] /> Green</label>
                        </li>
                      </ul>
                  
                      <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>
                  
                    • 31025
                    • 2 Posts
                    Some additional facts:

                    • Error message appears in modx log if I don’t use "emailReplyTo"
                    • If I use gmail it doesn’t show any error even I specify wrong smtp parameters