Perl Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPerl Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 3rd, 2001, 12:04 AM
wazza wazza is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2000
Location: Brisbane,Q,Au
Posts: 16 wazza User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hello Everyone,

Im after a script.. or sub that will allow me to send mass email to a list of clients based on the date they ordered from us. I have the datbase an everything up and running. I just dont know how to go about adding this part of the script.

I know theres proberly a simple solution but i just cant seem to get any thing working.

Any ideas or urls to something similar would be greatly appreciated.


Thanks for your time,
Wazza

Reply With Quote
  #2  
Old February 3rd, 2001, 09:36 AM
mickalo's Avatar
mickalo mickalo is offline
Ole` Timer
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2000
Location: N.W. Iowa
Posts: 469 mickalo User rank is Private First Class (20 - 50 Reputation Level)mickalo User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 5 h 19 sec
Reputation Power: 8
Send a message via AIM to mickalo Send a message via MSN to mickalo
Thumbs up More Details

How is the date formatted?? How is the date stored, in a flat file, Mysql table,..etc..??? When is the email suppose to be sent, in relationship to the date,..30 days from the date, 7, 14 ....etc...

Are you using "sendmail" or SMTP mail server....

Need some additional details

Mickalo
__________________

Thunder Rain Internet Publishing

Custom Programming & Database development
Providing Personal/Business
Internet Solutions that work!

Reply With Quote
  #3  
Old February 3rd, 2001, 11:46 AM
wazza wazza is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2000
Location: Brisbane,Q,Au
Posts: 16 wazza User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi Mickalo,
Here is my date sub.....
sub system_date {

my $time = shift;
my ($sec, $min, $hour, $day, $mon, $year, $dweek, $dyear, $tz) = localtime $time;
my @months = qw!Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec!;
$year = $year + 1900;
return "$day-$months[$mon]-$year";
}

Stored in a flat file database. And the email needs to be sent 14 days from the date ordered. And i am using sendmail.


Cheers,
Wazza

Reply With Quote
  #4  
Old February 3rd, 2001, 12:07 PM
mickalo's Avatar
mickalo mickalo is offline
Ole` Timer
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2000
Location: N.W. Iowa
Posts: 469 mickalo User rank is Private First Class (20 - 50 Reputation Level)mickalo User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 5 h 19 sec
Reputation Power: 8
Send a message via AIM to mickalo Send a message via MSN to mickalo
The date formatting your using, it would be very difficult to calculate the 14 day interval you need to trigger the email. This basically just creates a "pretty" date:

DD-MM-YYYY format


The easiest way to do this is to use UNIX localtime(time) function, then you can create you base date/time, the calculate the 14 day interval from that. The date format your using now is a "string" type date, not actually a numerical type date, and very hard to do any sort of calculations unless you convert it back to either time() or localtime(time).

Here's a little code snip used to calculate todays currect time and then calculate 14 interval:
Code:
$offset = 336; # 14 days(in hrs days x 24)
$offset_secs = ($offset*3600); # total secs(3600 equals 1 hr in secs) for 14days from todays date
$time_a = time();
$time_b = ($time_a + $offset_secs);


Now $time_a would equal todays date, and $time_b would equal 14 days for today. Now you have a numerical value to work with to do your calcuations.

Hope this might help

Mickalo

Reply With Quote
  #5  
Old February 3rd, 2001, 12:12 PM
wazza wazza is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2000
Location: Brisbane,Q,Au
Posts: 16 wazza User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Cool

Hi Mickalo,

Thanks alot. Ill give it a go.

Cheers,
Wazza

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPerl Programming > Sending email by date?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT