RE: mime lite

From: Chris Lyon (cslyon_at_qxzi.net)
Date: 06/04/04


To: <DBSMITH@OhioHealth.com>, <beginners@perl.org>
Date: Fri, 4 Jun 2004 14:10:39 -0700


> -----Original Message-----
> From: DBSMITH@OhioHealth.com [mailto:DBSMITH@OhioHealth.com]
> Sent: Friday, June 04, 2004 1:42 PM
> To: beginners@perl.org
> Subject: RE:mime lite
>
> Does anyone see anything logically wrong with my code b/c I am still not
> receiving the correct data in the email. The data is a # 1 when it should
> be a listing of Exxxxx strings.
>
> thank you!
>
> ## Set pragmas
>
> use strict;
> use MIME::Lite;
>
> ## 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";
> #if ( -s @ftapes ) {
> my $msg = MIME::Lite->new(
> From => 'EDM01 <root@edm01.ohnet>',
> To => 'Derek Smith <dbsmith@ohiohealth.com>',
> Subject => "Foreign Tapes Found, now attmepting to
> label",
> Data => print "@ftapes" );
Change this line to read
                                Data => "@ftapes"

> msg->send;
>
> #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:
> $!;"
> #}
> #close (RUNFILE);
>
> Derek B. Smith
> OhioHealth IT
> UNIX / TSM / EDM Teams
>
>
>
>
>
>
> <cslyon@qxzi.net>
> 06/04/2004 10:58 AM
> Please respond to cslyon
>
>
> To: <DBSMITH@OhioHealth.com>, <beginners@perl.org>
> cc:
> Subject: RE: sendmail
>
>
> > -----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
> >
>
>
>
> --
> To unsubscribe, e-mail: beginners-unsubscribe@perl.org
> For additional commands, e-mail: beginners-help@perl.org
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
>
>
>
>



Relevant Pages

  • RE: sendmail
    ... > Also it is not placing the array data into the email body??? ... bunch of things and moved everything over to MIME::Lite. ...
    (perl.beginners)
  • sendmail
    ... Also it is not placing the array data into the email body??? ...
    (perl.beginners)
  • RE:mime lite
    ... receiving the correct data in the email. ... > Also it is not placing the array data into the email body??? ... bunch of things and moved everything over to MIME::Lite. ...
    (perl.beginners)
  • Re: assigning printf statement to an array
    ... how does map know to create this array b/c I thought map expects a list ... > sort readdir DH; # get all files ...
    (perl.beginners)
  • Re: Loops performance contradictions.
    ... call are inlind when JITed, it's what happened to your array, aray.Count is ... > happen on each iteration. ... > Set the array data in about 3438380 ticks. ... > set the array data in about 3125800 ticks using built in iteration. ...
    (microsoft.public.dotnet.framework.performance)