You are here

function email_example_form in Examples for Developers 7

Same name and namespace in other branches
  1. 6 email_example/email_example.module \email_example_form()

The contact form.

Related topics

1 string reference to 'email_example_form'
email_example_menu in email_example/email_example.module
Implements hook_menu().

File

email_example/email_example.module, line 173
Example of how to use Drupal's mail API.

Code

function email_example_form() {
  $form['intro'] = array(
    '#markup' => t('Use this form to send a message to an e-mail address. No spamming!'),
  );
  $form['email'] = array(
    '#type' => 'textfield',
    '#title' => t('E-mail address'),
    '#required' => TRUE,
  );
  $form['message'] = array(
    '#type' => 'textarea',
    '#title' => t('Message'),
    '#required' => TRUE,
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Submit'),
  );
  return $form;
}