Have a look at the MIME::Entity module on http://search.cpan.org/
Use that to build your message, and then one of the mail modules, or even sendmail to send the message. On Mon, 2003-03-31 at 16:49, Brijesh Kanderia wrote: > Hi All, > > I dont have very much idea about perl programing. I have writen a small script which > reads the content of one file which keeps on changing daily. and sends the out put > to the concerned person thru mail. > > Now what I want is that I dont want the contents. I want this script to send this > txt file as an attachment to [EMAIL PROTECTED] now pls tell me how to do this. > > Regds > Brij > > > #!/usr/bin/perl > > sub get_date(); > > $SENDMAIL = "/usr/sbin/sendmail"; > $CAT = "/bin/cat"; > $logdir="/root"; > $mailfile = "$logdir/maillog.txt"; > mailto:$emailaddr="[EMAIL PROTECTED]; > > get_date(); > > sub get_date() > { > $DATE = `date +%Y%m%d`; > chop ($DATE); > #$day = `date +%d`; > #chop ($day); > #$hour = `date +%H`; > #chop ($hour); > } > > # send mail to whoever concerned > open (MAIL, "| $SENDMAIL [EMAIL PROTECTED] $emailaddr"); > printf MAIL "Subject: [PI-IN] Satyaki SMTP Maillog Report ($DATE)\n"; > $kitty = `$CAT $mailfile`; > print MAIL "$kitty\n"; > close(MAIL); > exit; -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]