I always like to use the Mail::Mailer module instead...
############################################# use Mail::Mailer; $mailer = Mail::Mailer->new("sendmail"); $mailer->open({ From => $from_address, To => $to_address, Subject => $subject, CC => $cc_address, }) or die "Can't open: $!\n"; print $mailer $body; $mailer->close(); ############################################### pretty similar to what you have except the part where i say print $mailer $body and then close the mail object. check the perl cookbook for this example explained... the $body varaible should be assigned above somewhere with the contents of a file or whatever.... good luck, tim --- Lance Prais <[EMAIL PROTECTED]> wrote: > I am unseeing the following piece of code to send > email. In order for this > email to be generated there needs to be an error in > my > script. > > use Mail::Sendmail; #Send and > email if there are errors > %mail = ( To => '[EMAIL PROTECTED]', > From => '[EMAIL PROTECTED]', > Subject => 'Email Manager not running', > Message => 'Email Manager not running' > ); > sendmail(%mail) or die $Mail::Sendmail::error; > print "OK. Log says:\n", $Mail::Sendmail::log; > > > I would like to include in the message excepts from > the .txt document I am > reading. Does any one know how to do this? > > I tried to use '((substr($line, 42, 7)' which the > text > I want to include but > it did not show the output. > > > If I do it like below the result id nothing in the > message portion of the email: > > > %mail = ( > To => '[EMAIL PROTECTED]', > From => '[EMAIL PROTECTED]', > Subject => 'Email Manager not running', > Message => substr($line, 42, 7), > ) > > Thank you > > -- > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > __________________________________________________ Do You Yahoo!? Send your FREE holiday greetings online! http://greetings.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]