Page 2 of 2 FirstFirst 12
Results 11 to 12 of 12

Thread: PHP Only Sending To One Email

  1. #11
    Join Date
    May 2007
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by thetestingsite View Post
    Try this:

    Code:
    <?php
    
    // All of the email addresses the message needs to be sent to
    $addresses = Array('me@domain.com','you@domain.com','test@example.com','email@website.com');
    
    //the subject of the message
    $subject = 'Test Email';
    
    //The body of the message
    $msg = <<<HERE
    This is the test email message. Change me to what you want the email to say
    HERE;
    
    foreach ($addresses as $to) {
     mail($to, $subject, $msg, 'From: PHP Script <noreply@domain.com>');
    }
    ?>
    Hope this helps.
    Scripts like that are pretty server intense when using a foreach or while to send mail or something.

  2. #12
    Join Date
    Apr 2006
    Posts
    584
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hey guys... Awsome all worked I also have a html email which I am sending and it wasn't working with the original code, but when I used explode it seemed to work... Any ideas as to why?

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •