function contact_mail_user in Drupal 5
Same name and namespace in other branches
- 4 modules/contact.module \contact_mail_user()
- 6 modules/contact/contact.pages.inc \contact_mail_user()
1 string reference to 'contact_mail_user'
- contact_user_page in modules/
contact/ contact.module - Personal contact page.
File
- modules/
contact/ contact.module, line 323 - Enables the use of personal and site-wide contact forms.
Code
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) . ' <' . check_plain($user->mail) . '>',
);
$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;
}