SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Guru
    Join Date
    Mar 2006
    Posts
    701
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    sending email message

    I have a "send newsletter" script.
    This do a loop at the subscribers table and send the message at each subscriber.
    how can I write a message while this script make this loop (like ' message sent to ...').
    I tried this, but it writes when loop is finished.
    Code:
    $counter=1;
    do {
     if (mail($to, $sub, $mess, $head))
    		 echo "mail".$counter++." sent";
    		 else
    		 echo "mail".$counter++." not sent";
    } while ($row_clients = mysql_fetch_assoc($clients));

  2. #2
    SitePoint Enthusiast
    Join Date
    Apr 2001
    Location
    London, UK
    Posts
    59
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    do {
     if (
    mail($to$sub$mess$head))
             echo 
    "mail".$counter++." sent";
             else
             echo 
    "mail".$counter++." not sent";
             
    flush();
    } while (
    $row_clients mysql_fetch_assoc($clients)); 


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
  •