BigRare has asked for the wisdom of the Perl Monks concerning the following question:
Edited: Retitled#!/usr/bin/perl -w use strict; use MIME::Lite; use Date::Calc qw(Today_and_Now Date_to_Text_Long); my $gmt; my $sleeptimer; my ($year,$month,$day, $hour,$min,$sec) = Today_and_Now([$gmt]); my $sig = "\n\nHere is my sig"; my $time = sprintf("%s, %s:%s:%s", Date_to_Text_Long($year,$month,$day), $hour, $min, $sec ); my $msg = MIME::Lite->new( From =>'test@account.com', To =>'test1@account.com', Cc =>'test2@account.com, test3@account.com', Bcc =>'test@account.com', Subject =>'This is a test message', Data =>"This message was sent from my script:\n\n +$time$sig" ); if ($min > 30) { $sleeptimer = 60 - $min; $sleeptimer = $sleeptimer * 60; } elsif ($min < 30) { $sleeptimer = 30 - $min; $sleeptimer = $sleeptimer * 60; } else { $sleeptimer = 1800; } if ($sleeptimer ne 1800) { sleep $sleeptimer; } do {$msg-> send('smtp', "mail.server.com", Timeout=>60); sleep 1800; redo; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Mail Test Script
by NetWallah (Canon) on May 05, 2004 at 21:47 UTC | |
by Thelonius (Priest) on May 05, 2004 at 21:52 UTC | |
by BigRare (Pilgrim) on May 05, 2004 at 23:52 UTC | |
by inman (Curate) on May 06, 2004 at 10:06 UTC |