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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.