Index: modules/contact.module =================================================================== RCS file: /cvs/drupal/drupal/modules/contact.module,v retrieving revision 1.18 diff -u -r1.18 contact.module --- modules/contact.module 27 Jun 2005 18:33:32 -0000 1.18 +++ modules/contact.module 13 Jul 2005 12:35:25 -0000 @@ -130,6 +130,10 @@ // Send the e-mail: user_mail($to, $subject, $body, "From: $from\nReply-to: $from\nX-Mailer: Drupal\nReturn-path: $from\nErrors-to: $from"); + // Send a copy if requested: + if($edit['copy']){ + user_mail($from, $subject, $body, "From: $from\nReply-to: $from\nX-Mailer: Drupal\nReturn-path: $from\nErrors-to: $from"); + } // Log the operation: flood_register_event('contact'); watchdog('mail', t('%name-from sent %name-to an e-mail.', array('%name-from' => theme('placeholder', $user->name), '%name-to' => theme('placeholder', $account->name)))); @@ -149,6 +153,7 @@ $output .= form_item(t('To'), $account->name); $output .= form_textfield(t('Subject'), 'subject', $edit['subject'], 60, 50, NULL, NULL, TRUE); $output .= form_textarea(t('Message'), 'message', $edit['message'], 60, 15, NULL, NULL, TRUE); + $output .= form_checkbox(t('Send a copy of this to me.'), 'copy', $edit['copy']); $output .= form_submit(t('Send e-mail')); $output = form($output); } @@ -266,6 +271,11 @@ // Send the e-mail to the recipients: user_mail($contact->recipients, $contact->subject, $body, "From: $from\nReply-to: $from\nX-Mailer: Drupal\nReturn-path: $from\nErrors-to: $from"); + // If the user requests it, send a copy. + if ($edit['copy']) { + user_mail($from, $contact->subject, $body, "From: $from\nReply-to: $from\nX-Mailer: Drupal\nReturn-path: $from\nErrors-to: $from"); + } + // Send an auto-reply if necessary: if ($contact->reply) { user_mail($from, $contact->subject, wordwrap($contact->reply), "From: $contact->recipients\nReply-to: $contact->recipients\nX-Mailer: Drupal\nReturn-path: $contact->recipients\nErrors-to: $contact->recipients"); @@ -299,6 +309,7 @@ $output .= form_textfield(t('E-mail'), 'mail', $edit['mail'], 60, 255, NULL, NULL, TRUE); $output .= form_select(t('Subject'), 'subject', $edit['subject'], $subjects, NULL, NULL, NULL, TRUE); $output .= form_textarea(t('Message'), 'message', $edit['message'], 60, 5, NULL, NULL, TRUE); + $output .= form_checkbox(t('Send a copy of this to me.'), 'copy', $edit['copy']); $output .= form_submit(t('Send e-mail')); $output = form($output); }