While a contact form is a simple concept, it can be a bit complex to get set up and operating. Read this whole page before doing it the first time. Don't give up; it really does work.

Setup

The easiest way to add a contact form to a basic Drupal site is to enable the contact module. You do this by clicking on:

  • (Drupal 7) - Administration > Modules
  • (Drupal 6) - Administer > Site building > Modules

You then locate the Contact module and enable it by checking the box and saving your change. (The Contact module is located in the core modules.)

You only get one contact form (at the URL http://mycompany.com/contact) but it can display a dropdown list of "Categories" for the types of issue that the user needs to contact you about. The results of the form for each category can be emailed to a different address. To use categories, click on:

  • (Drupal 7) - Administration > Structure > Contact form
  • (Drupal 6) - Administer > Site building > Contact form

For example, email for the Sales Department might be given a category of "Sales." The email address that the form is sent to may be sales@mycompany.com. If you want a reply automatically sent to the person sending the contact email, you can specify that here. Don't worry if you don't know them all right away, you can come back and change this at any time. Click the "Submit button."

Now click on the "Settings" tab. Here you can limit how many contact emails an individual may send in an hour -- this helps limit spamming. You may also turn on personal contact forms here; this allows users to contact each other. Click on the "Save configuration" button.

Grant access permissions

In order to allow people to use this contact form, you will need to give them permissions to do so.

Click Administer > User management > Access control (in D6 Administer > User management > Permissions or in D7 Administration > People > Permissions), locate the "Contact module" entry and enable it for the roles that will use Contact. Save your changes. The menu link (next step) will not be visible to anyone not having access.

Add "Contact" to the menu

Add the contact form to the menu is also easy. However there is on critical piece of information you will need and that is the relative page of the contact form. The relative path for the site wide contact form is contact (yes, it is simply contact). To add the site wide contact form to the main menu, you click on:

  • (Drupal 7) - Administration > Structure > Menus
  • (Drupal 6) - Administer > Site building > Menus

You can add a 'Contact' menu item as described in the Working with Menus section. Remember, the relative path for the site wide contact form in D7 is "contact"

Using it in content

To add a link to a content page use <a href="/contact">Contact Us</a>.

Need a customized contact form? Check the WebForm, Contact Forms or CCK modules.

Contact form spam

If you find you're getting spam emails through your contact form, check out an anti-spam module. For example: Gotcha module or the Captcha module.