Learn about the top 2016 CMS trends. Read on.

TYPO3’s FORM content object is pretty powerful and flexible by its own right. You often don’t need to go with the more powerful mail forms unless there’s specific functionality missing.

The code that follows shows a basic contact form for sales & support requests. It checks that the given email is valid. Upon form submission, an auto-response message is sent the submitter and the form redirects to a thank you or follow-on action page.

Name | *name=input
Email | *email=input |  | EMAIL
Phone | phone=input
Subject | subject=select | Support Request, Sales Inquiry
Request | comments=textarea
 | redirect=hidden | 20
 | auto_respond_msg=hidden | Thank you for your message.//We'll get back to you within a business day.
 | formtype_mail=submit | Submit
 | html_enabled=hidden | 0
 | from_email=hidden | sales@aihr.us
 | organisation=hidden | Aihrus

You can change Name, Email, and Subject of above to display as you’d like on the front-end. Don’t change name, email, and subject or else the sent email from name, from email, and subject will not be what the submitter provided.

The * before name and email denotes those fields as required.

The EMAIL of email, informs TYPO3 to confirm the input as an email address before clicking submit.

Learn More

Revised & updated from original publishing.

Still stuck? Write us.

  • Andres asked about adding a drop down for changing the email to. It’s a great question and one I didn’t know the answer to off hand. After a little bit of digging around, I’ve figured it out.

    Be warned, the changes might open your contact form up to spam. To counteract that, give the TYPO3 extension wt_spamshield a try.

    First, in typo3conf/localconf.php put the following formmail changes.

    $TYPO3_CONF_VARS[‘FE’][‘secureFormmail’] = 0;
    $TYPO3_CONF_VARS[‘FE’][‘strictFormmail’] = 0;

    Second, in your FORM content element, add a form field like the following named recipient to set the to email.

    Department | recipient=select | Sales=sales@aihr.us, Support=support@aihr.us, *Other=barney@aihr.us

    Additionally, you can put recipient_copy for Cc email.