We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3749
    • 24,544 Posts
    Quote from: pachinko at Sep 28, 2010, 04:17 AM

    I tried to figure this out, and if I understood it correctly, PHP mail() uses the SMTP server indicated in my PHP.ini, is that right?

    If this is so, there is no authentication, or is there? Will providers accept such mails anytime then? And is this safe against header injection (I suppose MODx has validation inbuilt here as well), or would you advise to get FormIt running without PHP mail()?

    Thanks for any help,
    Alex

    MODx will use SMTP on it’s own whenever a snippet sends mail if you set the SMTP System Settings. If you set those, don’t use the snippet’s SMTP parameters (if any).
      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
      • 22548
      • 58 Posts
      Hello BobRay!

      I thought so, as the docs says so too. So I used the plain Formit call with these system settings:
      mail_smtp_auth: Yes
      mail_smtp_hosts: smtpout.secureserver.net
      mail_smtp_pass: (my email password)
      mail_smtp_port: 25 (I tried 80 as well)
      mail_smtp_user: (my email account)
      mail_use_smtp: Yes
      As this did not work, I copied the Formit call for specific SMTP use, but that produced an error for missing recipient as well.

      E-mails were only sent, when I finally set "mail_use_smtp" to "No" (kind of strange, isn’t it). That is probably a small bug?

      My php.ini has the line: "SMTP = relay-hosting.secureserver.net", and I guess this server is used when I set "mail_use_smtp" to No.

      Basically, my questions are:

      - What settings did I set wrongly/are missing for SMTP to work? (Maybe I have to set a specific host for the HELO message?)

      - Are there any drawbacks if I set mail_use_smtp to No? And what does MODx do in this case (I am on Linux hosting, but there is no sendmail path in my php.ini)?

      EDIT:
      Quote from: m2_in_SJ at Sep 09, 2010, 09:52 PM

      BUT even when the email gets sent, the error log is still reporting that "you must provide an email address." So in my case it appears that the presence of that item in the log has nothing to do with whether the snippet is properly configured or not -- I’m getting the same error message anyway.
      I just noted this is true in my case, too. When I turn off SMTP and emails are sent, the error log still states that I didn’t enter a recipient.

      Best greetings,
      Alex
        • 17552
        • 46 Posts
        Hello community,

        I have exactly the same problems with FormIt.
        In the beginning I couldn’t sent a mail at all. Now this works. I don’t know why...

        But the error message "You must provide an email address to send to." appears anyway.


        A closer look to the code makes following clear:

        The error is thrown in: modphpmailer.class.php ( public function address($type, $email, $name= ’’) {...} )
        because $emailReplyTo and $emailReplyToName are empty!
        in fihooks.class.php ( public function email(array $fields = array()) {... --> /* reply to */ ...} )

        I don’t know why, because the default should be $emailFrom
        ( $emailReplyTo = $this->modx->getOption(’emailReplyTo’,$this->formit->config,$emailFrom); )

        Adding this attribute fixes the problem:
        &emailReplyTo=`sameEmailAsFrom`


        Kersten
          • 34120
          • 236 Posts
          I’m having similar problems here, email is sending but I get the error "You must provide an email address to send to"
          My validation isn’t working either, no validation messages appear and the emails are still sent.

          I’m sure my form was working ok not so long ago.
          Hope someone can help, I’ve stripped out my form and rebuilt it with the example from the documentation but still no joy.

          Revo 2.0.2-pl, Formit 1.4.0

          Thanks

            • 34120
            • 236 Posts
            I upgraded to Revo 2.0.4-pl2 and formit 1.4.1 and all is working fine, not sure what was going on.
              • 9065 ☆ A M B ☆
              • 15 Posts
              I have found one most frequent reason, why FormIt not working - it is using form action method GET - not POST. But it seems POST method is Required.