Problems, need help? Have a tip or advice? Post it here.
3 posts Page 1 of 1
Hi, is it possible to have the site-user's email address in the 'from' field? When I get the email I'd like to be able to hit reply but at the moment I am replying to myself. I understand it might be a security feature so even if the user's email address was included with my own?

Many thanks in advance.
I am not a developer but I can follow instructions!
Hi,

You can use the submitted email in the 'from' field if you so wish to.

As an example, in the snippet below the email field is named 'visitor_email'. The submitted value will therefore be available as a variable named 'frm_visitor_email' which is what we can now use for the 'from' parameter of the cms:send_mail tag -
Code: Select all
<cms:form method="post" anchor='0'>
    <cms:if k_success >
        <cms:send_mail from=frm_visitor_email to='you@yoursite.com' subject='Contact Form Submission'>
            <cms:show form_success />
        </cms:send_mail>
    </cms:if>
   
    <cms:input name='visitor_email' type='text' required='1' validator='email'  />

</cms:form>

Hope this helps.
Yes thank you, that is perfect! Just what I wanted :D
I am not a developer but I can follow instructions!
3 posts Page 1 of 1