How to Send Email in Drupal 7

by Owais Alam  August 26, 2016

The Contact Module allows site visitors to send emails in Drupal 7 to other authenticated users and to the site administrator. Through personal contact forms, users can send each other e-mail. And through site-wide contact forms, users can send e-mail to arbitrary email addresses, such as the site maintainers.

sending emails in drupal 7

With either form, users can specify a subject, write their message, and also have a copy of their e-mail sent to their own address. Through contact forms, users allow themselves to be contacted, yet keep their own e-mail addresses private until the message is replied to.

Step 1: Make Sure the Contact Module Is Enabled on Your Drupal 7 Website

step-01

  • Click Modules
  • Click Save configuration.

Step 2:  Go to Your Site URL

Navigate to the Contact Form page of your Drupal 7 site.  http://example.com/contact

step-02

Step 3: Go to Structure

Now go to structure as follows.

step-03

Step 4:  Add and Edit Categories

step-04

Click Add category to add a new one.

There is a default category called website feedback that you can use as well, but we are showing you how to add extra ones. You can edit the default category later if you need to.

Step 5:  Configure the Category

step-05

  • Give the category a name
  • Specify the Recipients
  • Create an Auto-reply message

Set Selected. Yes means it will be the default contact form. Since this is a new category, you probably want this to be No. You can only have one default.*

Be sure to click the Save button.

*Selected: When a visitor clicks on the link to the contact form, the categories will show in a drop down list. Whichever one is chosen with a “Yes” will show automatically. If you want your visitor to be forced to choose a category before submitting the form, make all of these fields “No”

Now it becomes as shown in the image below.

step-06

Now Contact Form looks like the image below.

step-07

Step 6: Add a Block With Instructions for the User

step-08

Go to Structure > Blocks.

Add a block.

step-09

Add the block information.

step-10

  • Enter a Block Description. This will not be seen by the public.
  • Enter a Block Title. This will be seen by the public.
  • Write your instructions. This will also be visible to the public.

Scroll down the page.

Step 7:  Set the Visibility Settings by Assigning It to the Contacts Page

step-11

  1. Choose “Only listed pages”. The only page we want to have these instructions is the Contact page.
  2. Write “contact” in the text field.
  3. Save the block.

Enable the block

step-12

step-13

Remember  to Save – scroll to the bottom of the page

step-14

No changes will be saved until you click Save blocks.
Your result should be as shown below.

step-15

Conclusion

While a contact form is a simple concept, it can be a bit complex to set up and operate. This tutorial on How To Send Email In Drupal 7 explained the features of site-wide contact form along with the drop down category for each of contact categories. I hope it was helpful. Feel free to leave a comment if you have any questions.

Also have a look on another blog post by us on, How To Install Varnish On Drupal 7?

Start Creating Web Apps on Managed Cloud Servers Now!

Easy Web App Deployment for Agencies, Developers and E-Commerce Industry

About Owais Alam

is the WordPress Community Manager at Cloudways – A Managed WooCommerce Hosting Platform and a seasoned PHP developer. He loves to develop all sorts of websites on WordPress and is in love with WooCommerce in particular. You can email him at owais.alam@cloudways.com

Stay Connected:

You Might Also Like...