RE: sendmail
cslyon_at_qxzi.net
Date: 06/04/04
- Next message: Wiggins D Anconia: "Re: Calling "more" in perl script for large files."
- Previous message: Charles K. Clarkson: "RE: sendmail"
- In reply to: DBSMITH_at_OhioHealth.com: "sendmail"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
To: <DBSMITH@OhioHealth.com>, <beginners@perl.org> Date: Fri, 4 Jun 2004 07:58:28 -0700
> -----Original Message-----
> From: DBSMITH@OhioHealth.com [mailto:DBSMITH@OhioHealth.com]
> Sent: Friday, June 04, 2004 6:39 AM
> To: beginners@perl.org
> Subject: sendmail
>
> ok here it what I did and it is emailing sporadically or not at all???
> Also it is not placing the array data into the email body???
> it is like the if clause it not working.
>
> thank you!
>
> ## Set pragmas
>
> use strict;
> use Mail::Sendmail;
>
> ## Set and edit variables
>
> my $foreigntapes="/usr/local/log/foreign_tapes.log";
> delete $ENV{'IFS'};
> local $ENV{'PATH'} =
> "/usr/epoch/bin:/usr/epoch/EB/bin:/usr/bin:/usr/sbin:/bin:/sbin";
> #print $ENV{'PATH'},"\n";
>
> ## Traverse through array and play with data
>
> open (OUT, ">$foreigntapes") || die "could not open file:$!";
> my @ftapes = grep s/^barcode=//, `evmvol -w label_state=1`;
> print OUT "@ftapes";
I would try to test something else besides the handle. I know you can do
these types of tests against a file but a handle? Not sure if that is the
best way to do it. Besides, you are testing if the file exists and have a
nonzero size against a handle. Test the array maybe?
> if ( -s OUT ) {
> my %mailman = ( From => 'EDM01 <root@edm01.ohnet>',
> To => 'Derek Smith <dbsmith@ohiohealth.com>',
> Subject => "Foreign Tapes Found, now attmepting to
> label" ,
> Message => print OUT "@ftapes" );
Try this for the Message line instead:
Message => "@ftapes" );
You might also want to try MIME::Lite for sending this. I know there is a
bunch of discussion about Mail::Sendmail and having it work correctly and
everybody recommends MIME::Lite instead. I was using Mail::Sendmail for a
bunch of things and moved everything over to MIME::Lite. Works like a charm!
> sendmail (%mailman) or die $Mail::Sendmail::error;
>
> foreach (@ftapes) {
> print $_;
> #`evmlabel -l st_9840_acs_0 -t 9840S -b$_`
> }
> close (OUT);
> } else {
> my $foo="/tmp/ftapes_runfile";
> open (RUNFILE, ">$foo") || die "could not open runfile:
> $!;"
> #exit 0;
> }
> close (RUNFILE);
>
>
> derek
>
- Next message: Wiggins D Anconia: "Re: Calling "more" in perl script for large files."
- Previous message: Charles K. Clarkson: "RE: sendmail"
- In reply to: DBSMITH_at_OhioHealth.com: "sendmail"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|