We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8384
    • 55 Posts
    All code posted below the last 2 replies. The site is on a godaddy server. The error message I am getting is:
    Main mail: Mailer was unable to send mailSMTP Error: Could not connect to SMTP host.
      • 20413
      • 2,877 Posts
      - Use a test snippet
      - Did you change eForm on all 3 places
      - Make sure e-mail not ends up in a spam folder.

      http://modxcms.com/forums/index.php?topic=40614.0
      http://www.techtalkz.com/php/66199-using-phpmailer.html ?

        @hawproductions | http://mrhaw.com/

        Infograph: MODX Advanced Install in 7 steps:
        http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

        Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
        http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower
        • 20413
        • 2,877 Posts
        The test snippet is copy/pasted correct and no double ending tags etc? Name it testmail
        and call it [!testmail!]
        <?php
        // The message
        $message = "Testing...";
        // Send
        mail('[email protected]', 'My Subject', $message);
        ?>



        Did you get eform errors BEFORE your SMTP modifications? When you edit files make sure
        that there is no utf bom or white-space etc.

        Try using the SSL server?
          @hawproductions | http://mrhaw.com/

          Infograph: MODX Advanced Install in 7 steps:
          http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

          Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
          http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower
          • 8384
          • 55 Posts
          Okay, so here is all the code:

          Calling eForm:
          [!eForm? &formid=`feedbackForm` &to=`[email protected]` &tpl=`eFeedBackForm` &report=`eFeedbackReport` &thankyou=`eFeedbackThanks` &vericode=`1` &subject=`Web Site Contact Form` !]


          There are 3 chunks being used:
          First one is {{eFeedBackForm}}
          [+validationmessage+]
          <form method="post" action="[~[*id*]~]" id="feedbackForm">
          <input type="hidden" name="formid" value="feedbackForm" />
          <table border=0>
          <tr>
          <td align="right"><label accesskey="n" for="name">Your Name</label></td>
          <td><input type="text" name="name" size="40" maxlength="40" eform="Your Name::1:Expected at least two words:#REGEX /^\w+\s\w+/i" /></td>
          </tr>
          <tr>
          <td><label accesskey="e" for="email">Your Email Address</label></td>
          <td><input type="text" name="email" size="40" maxlength="40" eform="Your Email Address:email:1" /></td>
          </tr>
          <tr valign="top">
          <td align="right"><label accesskey="c" for="comments">Regarding</label></td>
          <td><textarea cols="40" rows="10" name="comments" eform="Comments:html:1"></textarea></td>
          </tr>
          <tr>
          <td align="right">Please enter the <br />anti spam code<br />below:</td>
          <td><img src="[+verimageurl+]" alt="verification code" border="1"/></td>
          </tr>
          <tr>
          <td align="right"><label accesskey="c" for="vericode">code</label></td>
          <td><input type="text" name="vericode" size="20" /></td>
          </tr>
          <tr>
          <td></td>
          <td><input type="submit" name="submit" value="Send Message"></td>
          </tr>
          </table>
          </form>


          Second one is {{eFeedbackReport}}
          <p>This is a response sent by [+name+] using the feedback form on the website. The details of the message follow below:</p>
          <table>
          <tr valign="top"><td>Name:</td><td>[+name+]</td></tr>
          <tr valign="top"><td>Email:</td><td>[+email+]</td></tr>
          <tr valign="top"><td>comments:</td><td>[+comments+]</td></tr>
          </table>
          <p>You can use this link to reply: <a href="mailto:[+email+]?subject=RE:[+subject+]">[+email+]</a></p>


          Third one is {{eFeedbackThanks}}
          <h3>Thank you for your feedback</h3>
          <p>We know how you appreciate our ongoing efforts and thank you for your praise.
          We will take any suggestions you may have made to heart and will endeavor to 
          respond to you in a timely manner.  However as all office staff is attending
          our 4 week annual company retreat, this year held in the Costa Del Sol, we ask
          for your patience.</p>
          <p>Below is a copy of your message:</p>
          <table>
          <tr><td>Your name:</td><td>[+name+]</td></tr>
          <tr><td>Your email address</td><td>[+email+]</td></tr>
          <tr valign="top"><td>Your comments</td><td>[+comments+]</td></tr>
          </table>


          The code from eForm.inc.php in 5 places has been changed to:
          $mail->IsSMTP();
          $mail->Host = 'smtp.secureserver.net';


          The code in class.phpmailer.php has been changed to:
          var $Host        = "smtp.secureserver.net";
          var $Port        = 25;
          var $SMTPAuth     = true;
          var $Username     = "[email protected]";
          var $Password     = "password";


          Hopefully this posting has made it more clear as to what I’ve done, and hopefully someone will be able to help me!!!
            • 4310
            • 2,310 Posts
            Google’d and got this.
            Maybe your account isn’t enabled for relay and/or you need to change the port number.
              • 8384
              • 55 Posts
              Thanks Bunk58. I tried a few different port numbers. I think you’re right on the SMTP relay settings - The client’s godaddy account says their email is set up for SMTP relay, but then in another area it says it’s not. I’ve contacted godaddy and will update this thread with any results that happen.

              Thanks for everyone’s help.
              laugh
                • 8384
                • 55 Posts
                There were 2 things that needed to be done:

                1. the SMTP host name needed to be changed (godaddy tech help sent me this)
                2. the port needed to be changed (played around with that one).

                Thanks for listening and guiding!

                Things are so nice when they work... and it was such a noobley thing too. rolleyes
                  • 4310
                  • 2,310 Posts
                  grin Got there in the end.
                    • 30552
                    • 75 Posts
                    I’m glad your problem is solved, but I wonder why you wouldn’t post the hostname and port that ended up working for you? That way, this post becomes helpful for anyone who may have the same problem.