Jump to content

Send Once ?


balkan7

Recommended Posts

How can i limit send to mail once, if i got on site more guests or members send many messages, i wanna to send just once.

 

code is:

 

 // send msg 1 week before expire
          $now = time();
          $week = $now+(60*60*24*7);
          $nextweek = date("Y-m-d H:i:s", $week);
       
            if ($data['expire'] <= $nextweek && $data['expire'] >=$now) {
	 $to = $user_email;
         $from = "From:". $locale['M_EMAIL'];
         $msg = $locale['M_110'].$user_name."\n\n".$locale['M_111'];
         $subject = "Hello from ".$locale['M_SITE'];
                 mail($to,$subject,$msg,$from);
             
             }

Link to comment
https://forums.phpfreaks.com/topic/113245-send-once/
Share on other sites

From what I understand is that you want to send an expiry notice to members only once and this script runs everytime someone visits the site correct?  You will have to store somewhere (database, txt file, etc) data that says whether an email has been sent to that user for expiration or not.  Easiest way is what I suggest above. 

Link to comment
https://forums.phpfreaks.com/topic/113245-send-once/#findComment-581802
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.