WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDESPHP CLASSESCODE SEARCHARTICLES SEARCHPHP FORUMSPHP MANUALPHP FUNCTIONS LISTWEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Join us on FaceBook
Submit a code Example / Snippet Submit Your Code
Poker Tournaments Poker Tournaments
Poker Guide for Developers Poker Guide for Developers
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Resources
Web Development Content
Internet Security Software
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
פרייסז - הכח לקנות עובר לידיים שלך
Texas Holdem Poker Evangelists

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : Sending mail to a mailing list and showing progress
Categories : PHP, Mail, Beginner Guides
Boaz Yahav
Date : Apr 20th 2007
Grade : 5 of 5 (graded 1 times)
Viewed : 4062
File : No file for this code example.
Images : No Images for this code example.
Search : More code by Boaz Yahav
Action : Grade This Code Example
Tools : My Examples List

Submit your own code examples  Submit your own code examples 
 

When sending mail to a big list using the mail() function you don't see the progress. It can take a long time to send the mail and the user does not see if the process is working or not. Here is a solution that shows the activity in real time by printing the emails and using the flush() function.

You can see the function here :
http://www.weberdev.com/flush

<?
include"dbcon.inc" //DB connection settings
$Result=mysql_query("SELECT Name,Email FROM Emails"); //Get the list of emails
While($row = mysql_fetch_object($Result)) {
    Echo
"Sending Mail to $row->Email";
   
mail($row->Name ."<" . $row->Email . ">","The Subject","The body","The Headers");
   
flush(); //This will flush the names to the screen after each mail.
}
?>



PHP Image Validation Class - test if a specific file is of a certain image type without relying on the said file extension.
Categories : PHP, PHP Classes, Data Validation, Graphics, Beginner Guides
Form Validation Using PHP to highlight non valid fields
Categories : PHP, Form Processing, Data Validation, Beginner Guides
Multiple Select box, Select multiple Items from Menu.List box
Categories : PHP, HTML and PHP, Beginner Guides
Simple Cookie example
Categories : PHP, Beginner Guides, Cookies
Using PHP im HTML image tags
Categories : PHP, HTML and PHP, Graphics, Beginner Guides
Automatic global variable definer
Categories : PHP, Variables, Beginner Guides
Specify your connection settings and create a link to a MySQL database.
Categories : PHP, PHP Classes, Databases, MySQL, Beginner Guides
Newbie Notes #4 - Trapping dumb MySQL query errors
Categories : PHP, Databases, MySQL, Debugging, Beginner Guides
email new items in db
Categories : PHP, Email, Databases, MySQL, Beginner Guides
A flat file counter
Categories : PHP, Cookies, Filesystem, Beginner Guides
Basic Authentication with sessions
Categories : PHP, Beginner Guides, Authentication, Form Processing, Sessions
Newbie Notes #1 - Making a form return to itself
Categories : PHP, Beginner Guides, HTML and PHP
Data Retrieve from mailbox and generate the SQL Syntax
Categories : PHP, IMAP, Mail
mySQL/PHP/search with multientry form and table output with colored rows
Categories : PHP, Beginner Guides, MySQL, HTML and PHP, Databases
Simple Session example
Categories : PHP, Beginner Guides, Sessions