On Tue, 08 Mar 2005 18:00:52 -0500, Amy Kline wrote: > Hi, > How do I modify the following code to email a file (textfile.txt) to > [EMAIL PROTECTED] > > open (MAIL, "|/usr/bin/mail [EMAIL PROTECTED]"); > print MAIL "Subject: test"; > print MAIL "This is a test"; > close MAIL; > > The above code works fine
Really? With no newlines? You're not running with -l, are you? > but instead of sending the text - "This is a > test", I would like to send a file, textfile.txt. open MSG, '<', 'textfile.txt' or die "Can't open: $!\n"; print MAIL <MSG>; close MSG; -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>