We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10525
    • 247 Posts
    Hi Folks,

    the title pretty much says what I am trying to do, but to clarify:

    I have a very small Contact Us form (First name, Last name, Telephone, Email, Enquiry). The form is validated correctly, and the email is sent.

    I want the From name in the received email to be the First name + Last name that the user entered into the form. The following line works fine:

    &emailFromName=`[[+FirstName]] [[+LastName]]`


    I also want the email address in the received email to be the Email address that the user entered into the form. The following line results in the email not being sent, with no error message:

    &emailFrom=`[[+Email]]`


    If I enter a hardcoded email address, such as
    &emailFrom=`[email protected]`
    , the email is sent ok.

    The form field names are correct (validation works and the email fields are filled correctly).

    Can anyone suggest where I am going wrong, and how I can get the user's email address entered in the form into the snippet call?

    My snippet call:

    [[!FormIt?
    &hooks=`spam,email,redirect`
    &submitVar=`contactUsFormSubmit`
    &validationErrorMessage=`<p class="error">Woops! Something is entered wrongly or missing. Please check the values you have entered:</p><ul class="errors">[[+errors]]</ul>`
    &emailTpl=`contactEmail`
    &emailTo=`[email protected]`
    &--emailFrom=`[email protected]`
    &emailFrom=`[[+Email]]`
    &emailFromName=`[[+FirstName]] [[+LastName]]`
    &emailSubject=`Enquiry from website`
    &redirectTo=`7`
    &validate=`antispam:blank,
    FirstName:required,
    LastName:required,
    Email:email:required,
    Enquiry:required:stripTags`
    ]]

    I am using:
    MODX Revolution 2.2.2-pl (traditional)
    FormIt 2.0.3 pl

    Let me know any other details you might need.
    Thanks.
      • 28104
      • 8 Posts
      As a default setting, FormIt will send an email with the gathered Email address in the Form field.
      Did you try with these 2 lines removed?
      &--emailFrom=`[email protected]`
      &emailFrom=``
        • 10525
        • 247 Posts
        HI SpaceTurtle,

        thanks for your reply.

        I am rewriting this reply after spending nearly an hour testing and entering details, only to lose my clear and detailed message when I clicked 'view' :-( Nearly threw something in the kitchen.

        Right, to cut a long story short:

        Yes, I did try without these two lines.

        (The placeholders in both
        &emailFrom=``
        &emailFromName=` `
        were stripped out because I didn't tag them as code.)

        I have tried a whole range of tests, but if I don't include a hard-coded email address in &emailFrom I always get the same address that I have registered as "Send mail as" in my gmail account. I have tried different &emailTo addresses (gmail and hotmail), different computers (to avoid cookie sniffing by either), changed my admin email address in MODx, searched MODx database for the offending FROM email address (clear).

        So, since formIt won't behave for me as documented and use the email address that the user enters, I have to force it to do this, and I can't.

        Any suggestions?