We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19328
    • 433 Posts
    I’ve a formit form on my website. I want the following to happen:

    - Form is sent using SMTP from Google apps e-mailadress as configured in MODx System Settings. ([email protected] in the codes below)
    - From this Google apps e-mailaccount an autoreply is sent to the person who filled in the form, to the e-mailadress that person has filled in.([email protected] in the codes below).

    Everything works, except the auto reply from the google apps account is sent to the google apps address (the ’SMTP user’) instead of the e-mailadress of the site visitor.

    This is my formit call:

    [[!FormIt?
       &hooks=`spam,FormItAutoResponder,email,redirect`
       &store=`1`
       &emailTpl=`contactformulierEmailTpl`
       &emailTo=`[email protected]`
       &emailFrom=`[[+E-mailadres]]`
       &emailFromName=`[[+Naam]]`
       &emailReplyTo=`[[+E-mailadres]]`
       &emailReplyToName=`[[+Naam]]`
       &redirectTo=`22`
       &submitVar=`submitContact`
       &emailSubject=`Reactie via contactformulier`
       &fiarTpl=`autoResponderTpl`
       &fiarSubject=`Kopie van uw ingestuurde contactformulier`
       &fiarToField=`E-mailadres`
       &fiarFrom=`[email protected]`
       &fiarFromName=`Company`
       &fiarReplyTo=`[email protected]`
       &fiarReplyToName=`Company`
    &customValidators=`FormItValidator`
    &validate=`Naam:required:FormItValidator:stripTags, E-mailadres:required:email:FormItValidator:stripTags, Bericht:required:FormItValidator:stripTags`
      
    ]]


    MODx System Settings:


    In the e-mail that is sent to the google apps account the following headers are included:

    Return-Path: <[email protected]>
    Received: from domain.com 
            by mx.google.com with ESMTPS;
            Fri, 14 Jan 2011 02:44:44 -0800 (PST)
    Date: Fri, 14 Jan 2011 11:44:42 +0100
    Return-Path: [email protected]
    To: [email protected]
    From: Visitor Name <[email protected]>
    Reply-To: "Company" <[email protected]>, Visitor Name <[email protected]>
    Subject: Reactie via contactformulier
    Message-ID: <[email protected]>
    X-Priority: 3
    X-Mailer: PHPMailer (phpmailer.sourceforge.net) [version 2.0.4]
    MIME-Version: 1.0
    Content-Transfer-Encoding: 8bit
    Content-Type: text/html; charset="UTF-8"



    The reason the auto reply is sent to the google apps account, is probably because of this line: From: Visitor Name <[email protected]>
    The name that is filled in the form is placed here correctly, but the wrong e-mailadress is used (not the ’Emailfrom’ that is set in the formit snippet call, but the SMTP user from the MODx System Settings).
    Also ’Return-path’ turns up twice in the header, first with [email protected], and second with the e-mailadress of the visitor.

    I hope someone can point me in the right direction as to why the e-mailadress of the visitor is not used in the From e-mailadress. Could it be something that Google does when sending with Google’s SMTP? Thanks for any help.

    I’m using:
    - Revolution 2.0.6-pl2
    - Formit 1.5.2-pl
      • 7976
      • 36 Posts
      Change your ’SMTP Hosts’ in the system settings to ’smtp.googlemail.com’ (without the port). This should work.

      (p.s. glad to see the FormItValidator in use smiley)
        Jack of all Trades and Proud Honda Zoomer owner. Also available on twitter.
        • 3749
        • 24,544 Posts
        That is something Google does. I’ve never tried it with googlemail in the host name, so that may help. If not, you can include the user’s email in the message with a placeholder.

        [update] I just tried it with smtp.googlemail.com and it made no difference. Google still changes the sender to the gmail account holder.
          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
          • 7976
          • 36 Posts
          I noticed this behaviour too, even the validation was giving a validation-error on my field name: ’email’.

          I changed my codes with yours and after it I had it working. Perhaps ’FormItAutoResponder’ and/or ’store’ is killing the process? (because I ain’t using that part)
            Jack of all Trades and Proud Honda Zoomer owner. Also available on twitter.
            • 3749
            • 24,544 Posts
            It’s my understanding that Gmail always puts the name of the Gmail account holder in the from header when you send SMTP through Gmail.

            Are you saying you’ve found a way around this? If so, I’d love to hear the details.
              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
              • 36416
              • 589 Posts
              Quote from: BobRay at Apr 20, 2011, 06:46 PM

              It’s my understanding that Gmail always puts the name of the Gmail account holder in the from header when you send SMTP through Gmail.
              Are you saying you’ve found a way around this? If so, I’d love to hear the details.

              Hmmm, never tried it myself - but maybe this can help:
              https://www.google.com/calendar/b/0/render?eid=dDFpNWU3MHZpbXV1dTdxbmptNWtscHJycTggZ29vZ2xlYXBwcy5jb21fMnNocGE2b2E1NGRnNm9sMzIwaXJjaGMwcGtAZw&ctz=America/Los_Angeles&gsessionid=OK&sf=true&output=xml
                • 3749
                • 24,544 Posts
                Interesting, but it has a down side:

                If your mail provider doesn’t support secured connections to their mail servers, we do offer port 25 in an unsecured connection. With an unsecured connection, your information won’t be encoded, which means it’s possible for someone to see your login credentials and message data when you connect.
                  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