contact_mail_user

Versions
4.6 – 4.7
contact_mail_user()
5
contact_mail_user($recipient)
6
contact_mail_user(&$form_state, $recipient)

Code

modules/contact/contact.module, line 323

<?php
function contact_mail_user($recipient) {
  global $user;
  $form['#token'] = $user->name . $user->mail;
  $form['from'] = array('#type' => 'item',
    '#title' => t('From'),
    '#value' => check_plain($user->name) .' &lt;'. check_plain($user->mail) .'&gt;',
  );
  $form['to'] = array('#type' => 'item',
    '#title' => t('To'),
    '#value' => check_plain($recipient->name),
  );
  $form['subject'] = array('#type' => 'textfield',
    '#title' => t('Subject'),
    '#maxlength' => 50,
    '#required' => TRUE,
  );
  $form['message'] = array('#type' => 'textarea',
    '#title' => t('Message'),
    '#rows' => 15,
    '#required' => TRUE,
  );
  $form['copy'] = array('#type' => 'checkbox',
    '#title' => t('Send yourself a copy.'),
  );
  $form['submit'] = array('#type' => 'submit',
    '#value' => t('Send e-mail'),
  );
  return $form;
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.