brianlois has asked for the wisdom of the Perl Monks concerning the following question:
#!c:\perl\bin\perl #-w # #use strict; use Time::Format qw(%time %strftime %manip); use Net::SMTP; use File::Copy; $ctime="$time{'hh:mm'}"; $yesterday="$time{'yyyymmdd', time-24*60*60}"; $lastmonth="$month_len[$month - 1]"; $cdate="$time{'yyyy.mm.dd'}"; $file1="OPTUS.ECBOT.ZIP"; $log="email.log"; my $subject = "subject"; my $mailfrom = "email@mail.com"; my $mailto = "email@mail.com"; print "Sending message to $mailto\n"; my $stat_filename = "email.log"; my ($serverName) = "mailserver"; my $smtp = Net::SMTP->new($serverName, Timeout => 60); # die "Couldn't connect to server $smtp" unless $smtp; $smtp->mail( $mailfrom ); $smtp->to( $mailto ); $smtp->data(); $smtp->datasend("From: ", $mailfrom, "\n"); $smtp->datasend("Subject: $subject\n"); $smtp->datasend("MIME-Version: 1.0\n"); $smtp->datasend("Content-Disposition: attachment; filename=\"OPTUS.ECB +OT.ZIP\"\n"); $smtp->datasend("Content-Type: application/zip; name= $file1 "); $smtp->dataend(); $smtp->quit(); exit;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Emailing ZIP Attachment
by tirwhan (Abbot) on Dec 23, 2005 at 22:00 UTC | |
|
Re: Emailing ZIP Attachment
by zentara (Cardinal) on Dec 23, 2005 at 22:57 UTC | |
|
Re: Emailing ZIP Attachment
by shiza (Hermit) on Dec 23, 2005 at 22:05 UTC | |
|
Re: Emailing ZIP Attachment
by hsinclai (Deacon) on Dec 23, 2005 at 23:57 UTC | |
|
Re: Emailing ZIP Attachment
by reneeb (Chaplain) on Dec 24, 2005 at 01:58 UTC | |
|
Re: Emailing ZIP Attachment
by ptum (Priest) on Dec 23, 2005 at 21:54 UTC | |
|
Re: Emailing ZIP Attachment
by Joost (Canon) on Dec 23, 2005 at 23:36 UTC | |
by Anonymous Monk on Sep 06, 2019 at 19:22 UTC |