|
|
|
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.
}
?> | | |
|
| Cut your MySQL Connections to 1 line of code Categories : PHP, Beginner Guides, Databases, MySQL | | | Real simple example of removing HTML tags from text then changing \n (new line) to <br>. Could be used in a forum for instance. Categories : HTML, PHP, HTML and PHP, Beginner Guides | | | Basic Authentication with sessions Categories : PHP, Beginner Guides, Authentication, Form Processing, Sessions | | | Data Retrieve from mailbox and generate the SQL Syntax Categories : PHP, IMAP, Mail | | | PHP and javascript mouseover, mouseout, and mousedown events Categories : PHP, Java Script, Form Processing, Beginner Guides | | | Link Submition - Allow your visitors to submit links to the site. Categories : PHP, Arrays, Filesystem, Beginner Guides | | | Simple Session example Categories : PHP, Beginner Guides, Sessions | | | a PHP Function to Get only the filename (remove the extension) using regular expressions. Categories : PHP, Regexps, Beginner Guides | | | for each record, do this to the first record, and do that to any subsequent record Categories : PHP, Databases, MySQL, Beginner Guides | | | Upload Via FTP - an alternative to move_uploaded_file Categories : PHP, FTP, Beginner Guides | | | Convert text to 'quoted printable' without the IMAP package installed. Categories : PHP, Mail, IMAP | | | Newbie Notes #5 - To double quote, or single quote, that is the question Categories : PHP, Beginner Guides, Variables | | | Change the background color of a website daily dynamically using the php date function to get the current day of the week and depending on that day, set the background color for the web page. Categories : PHP, Date Time, Beginner Guides, Web Design | | | Protect your email links from being spidered by spam email robots! Categories : PHP, Security, Mail, Email | | | Convert a File database into MySQL Categories : PHP, Filesystem, Databases, MySQL, Beginner Guides | |
|
|