Current location: Hot Scripts Forums » Programming Languages » PHP » send emails every day to users in db every day by a crtain time

send emails every day to users in db every day by a crtain time

Reply
  #1 (permalink)  
Old
New Member
 
Join Date: Feb 2013
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
send emails every day to users in db every day by a crtain time

Wondering if some one could send me a php script to send email to all members every day by 5 pm.
Thanks and appreciate your help in advance
Reply With Quote

Featured Marketplace Scripts (view more)

  #2 (permalink)  
Old
Wannabe Coder
 
Join Date: Dec 2007
Posts: 118
Thanks: 1
Thanked 1 Time in 1 Post
You would create a simple script which loops through all the members and mails them. At its most basic, something like this...

PHP Code:



$q 
"SELECT * FROM users WHERE active= 'Y'";
$r=mysql_query($q) or die(mysql_error()); 
$num=mysql_num_rows($r); 
    
if(
$num 0)
while(
$row mysql_fetch_assoc($r)) {

$useremail $row['email'];

// The message
$message "This is a message to all our users.";


$message wordwrap($message70"\r\n");

// Send
mail('$useremail''My Subject'$message);


The key to making it happen every day is to use CRON JOBS on your server.

cron jobs
__________________
New Wave Creative Media - Leeds based web design and digital agency.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Testers needed Boraan The Lounge 32 06-30-09 10:38 AM
Energy Recharge-10 min code Ishmell PHP 23 12-20-07 02:32 AM
send a message to more users zoliky PHP 29 10-31-06 01:36 PM
Subscribe to newsletter, store in file, and send mass emails macoylea Script Requests 0 11-27-05 08:36 PM
Showing time is users time zone? Nasimov PHP 1 11-20-03 07:14 AM


All times are GMT -5. The time now is 06:40 PM.
vBulletin® Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.