I have a database of users with their emails but as my hosting provider doesn't allow mass emails I was wondering if there is a way so that I can send the same email to everyone in the database but 1 person ever 1 minute. So that It sends to person '1' and waits one minute then sends to person '2' and waits one minutes and keeps doing that till it has sent to everyone. I have php and html knowledge and also a bit of javascript. Thanks
Okay, well you could run a script in the background, perhaps as cron job, and sleep() one minute after every email. As long as you don't have many users, it won't be a problem. But once there's more, you should look for an alternative method. set_time_limit(0); ignore_user_abort(true); while (/* ... */) { mail(/* ... */) sleep(60); } PHP: ... alternatively, you could sign up for Amazon SES, and send your emails through their servers. This way you don't have these limitations. It's very cheap too.
What do i use to send the email to all users and how do i pull them all into a variable. What about google apps and sending through their servers? If i use google apps how can I send it to all users easily?
If you have all your e-mails in a database you can use the following code: <?PHP $conn = mysql_connect('localhost', 'db_username', 'db_password'); mysql_select_db('db_name', $conn); $sql = "SELECT * FROM table"; $result = mysql_query($sql); while($row = mysql_fetch_array($result)) { mail($row[email_column_name],"Subject","E-Mail Body"); sleep(60); } ?> Code (markup):
Hi Guys, What I did is echoed out all the usernames and emails from my table to a file then used MaxBulk Mailer and connected to my google apps account. Then I loaded the emails from web page and boom they all popped up which then allowed me to create a nice message and send to all users. This is what the email looked like.
Well, i am using 'phpmailer' class to send emails to my users. This class handles all things, even customized template of Email. have look at this tutorial:- http://www.rashflash.com/index.php/projectcontroller/displayProjectExplanation/send-email-using-php