You are here

function email_mail_page_form in Email Field 5

Same name and namespace in other branches
  1. 6.2 email.module \email_mail_page_form()
  2. 6 email.module \email_mail_page_form()
  3. 7 email.module \email_mail_page_form()
1 string reference to 'email_mail_page_form'
email_mail_page in ./email.module
The contact form page.

File

./email.module, line 246

Code

function email_mail_page_form() {
  global $user;
  if ($user->uid) {
    $edit['name'] = $user->name;
    $edit['mail'] = $user->mail;
  }
  $form['#token'] = $user->name . $user->mail;
  $form['name'] = array(
    '#type' => 'textfield',
    '#title' => t('Your name'),
    '#maxlength' => 255,
    '#default_value' => $edit['name'],
    '#required' => TRUE,
  );
  $form['mail'] = array(
    '#type' => 'textfield',
    '#title' => t('Your e-mail address'),
    '#maxlength' => 255,
    '#default_value' => $edit['mail'],
    '#required' => TRUE,
  );
  $form['subject'] = array(
    '#type' => 'textfield',
    '#title' => t('Subject'),
    '#maxlength' => 255,
    '#required' => TRUE,
  );
  $form['message'] = array(
    '#type' => 'textarea',
    '#title' => t('Message'),
    '#required' => TRUE,
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Send e-mail'),
  );
  return $form;
}