Jump to content

send email every x time


egturnkey

Recommended Posts

Hello friends,

 

the following is a send email function

$subject = "subject here";
$message = "message here";
$headers = "From: "."{$mailscript}\r\n"."Reply-To: "."{$mailscript}\r\n"."X-Mailer: PHP/".phpversion( );
@mail( $mailgust, $subject, $message, $headers );

 

 

how can i make it send every X time

 

i can make a compare btween time now by let

$timestamp = mktime($timestamp);

and set certain time

$timestamp1 = mktime(0, 0, 0, 12, 20, 2010);

 

and if it > then it then it send

 

but this is for specific time

 

:-\ but i want it send every X time ( says week ) ..  :shrug:

 

so any help here.

 

thanks friends

 

Link to comment
https://forums.phpfreaks.com/topic/194302-send-email-every-x-time/
Share on other sites

Use CRON to run the mail script on the specified interval? Hard to follow the actual question :)

 

thanks for your reply, but i don't wanna use cronjob

 

i wonder if there was a way that i can make for examle an array

 

let the time now is

 

$timestamp = mktime($timestamp);

 

so can i make array it send for example when it = any of the following times

 

$timestamp1 = mktime(0, 0, 0, 12, 20, 2010);

and

$timestamp1 = mktime(0, 0, 0, 12, 21 2010);

and

$timestamp1 = mktime(0, 0, 0, 12, 22, 2010);

 

ect

 

it just an idea i don't know if it possible or not  :shrug: so if it can be then can anyone help me how to write it

Since php is a server side language, are you suggesting that you would just tell the script to continuously run? Obviously because of script timeouts that won't work, so either way you are going to have to have something kick the script off to check the time? Are you prejudiced against cron for some reason? :)

 

Since php is a server side language, are you suggesting that you would just tell the script to continuously run? Obviously because of script timeouts that won't work, so either way you are going to have to have something kick the script off to check the time? Are you prejudiced against cron for some reason? :)

 

I will insert it as a code within a php file

say  manal.php

then once someone call that file website.com/manal.php

 

the function should compare the time then will send

 

it act like a call back functions, or protection functions for scripts..ect

 

but it indeed has many usefull ideas.

 

thanks you

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.