help with sending mail by looping through array of the TO field

From: NotGiven (noname_at_nonegiven.net)
Date: 11/29/03


Date: Sat, 29 Nov 2003 10:48:59 -0500

I have an array called $addresses containing all the email addresses of
people to receive an email. Does the following code look like it should
work? Does the the foreach loop look correct?

$subject = "Please complete this paper";
$message = '
You have been invited to the department's annual social on Dec 19.

Please RSVP by Dec 3.

Many thanks.';
$headers = "From: Dean<ImtheDeam@xyz.edu>\r\n";

foreach ( $addresses as $addr ) {
 mail($addr, $subject, $message, $headers);
}