Index: modules/contact.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/contact.module,v
retrieving revision 1.26
diff -u -p -r1.26 contact.module
--- modules/contact.module	11 Oct 2005 19:44:34 -0000	1.26
+++ modules/contact.module	31 Oct 2005 13:22:33 -0000
@@ -146,11 +146,11 @@ function contact_user_mail_execute($form
   $body = implode("\n\n", $message);
 
   // Send the e-mail:
-  user_mail($to, $subject, $body, "From: $from\nReply-to: $from\nX-Mailer: Drupal\nReturn-path: $from\nErrors-to: $from");
+  drupal_mail($to, $subject, $body, array('From' => $from, 'Reply-To' => $from, 'Return-Path' => $from, 'Errors-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");
+    drupal_mail($from, $subject, $body, array('From' => $from, 'Reply-To' => $from, 'Return-Path' => $from, 'Errors-To' => $from));
   }
 
   // Log the operation:
@@ -301,16 +301,17 @@ function contact_mail_page_execute($form
   $contact = db_fetch_object(db_query("SELECT * FROM {contact} WHERE category = '%s'", $edit['category']));
 
   // Send the e-mail to the recipients:
-  user_mail($contact->recipients, $subject, $body, "From: $from\nReply-to: $from\nX-Mailer: Drupal\nReturn-path: $from\nErrors-to: $from");
+  $to = explode(',', $contact->recipients);
+  drupal_mail($to, $subject, $body, array('From' => $from, 'Reply-To' => $from, 'Return-Path' => $from, 'Errors-To' => $from));
 
   // If the user requests it, send a copy.
   if ($edit['copy']) {
-    user_mail($from, $subject, $body, "From: $from\nReply-to: $from\nX-Mailer: Drupal\nReturn-path: $from\nErrors-to: $from");
+    drupal_mail($from, $subject, $body, array('From' => $from, 'Reply-To' => $from, 'Return-Path' => $from, 'Errors-To' => $from));
   }
 
   // Send an auto-reply if necessary:
   if ($contact->reply) {
-    user_mail($from, $subject, wordwrap($contact->reply), "From: $contact->recipients\nReply-to: $contact->recipients\nX-Mailer: Drupal\nReturn-path: $contact->recipients\nErrors-to: $contact->recipients");
+    drupal_mail($from, $subject, wordwrap($contact->reply), array('From' => $contact->recipients, 'Reply-To' => $contact->recipients, 'Return-Path' => $contact->recipients, 'Errors-To' => $contact->recipients));
   }
 
   // Log the operation:
