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

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • NotGiven

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

    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);
    }


  • Pedro Graca

    #2
    Re: help with sending mail by looping through array of the TO field

    NotGiven wrote:[color=blue]
    > 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?[/color]

    What hapenned when you tried?

    [color=blue]
    > $subject = "Please complete this paper";
    > $message = '
    > You have been invited to the department's annual social on Dec 19.[/color]
    _______________ _______________ ___________^___ ___
    you need to escape this quote!

    [snip]

    Yes, the foreach looks correct.
    --
    --= my mail box only accepts =--
    --= Content-Type: text/plain =--
    --= Size below 10001 bytes =--

    Comment

    Working...