You are here

function email_example_form in Examples for Developers 6

Same name and namespace in other branches
  1. 7 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
Implementation of hook_menu().

File

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

Code

function email_example_form() {
  $form['intro'] = array(
    '#value' => 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;
}