RE: sendmail

cslyon_at_qxzi.net
Date: 06/04/04


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
>



Relevant Pages

  • 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: mime lite
    ... > Derek B. Smith ... >> Also it is not placing the array data into the email body??? ...
    (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)
  • Re: Add/remove zero index of array
    ... One other alternative, presuming that the goal of this effort is to keep prying eyes from seeing the values of the 0 member, is to just write the entire array to disk when overwrite the 0 record with some character. ... Some of the array data gets ... >>> Dim NumOfRecs as Long ...
    (microsoft.public.vb.general.discussion)
  • Re: n00b input help
    ... I'm writing a program that performs arithmetic operations on ... I want to be able to type in a bunch of integers ... sort it, convert it into an array, or what-not. ... Linked lists are ...
    (comp.lang.c)