in reply to Email using sendmail

Lets tidy that up a bit, shall we?

And this gives us:

#!/usr/bin/perl use strict; use warnings; use Mail::Mailer; my $mailer = Mail::Mailer->new("sendmail"); print "\nRecipient Address:"; chomp (my @to = split /;/,<STDIN>); print "\nFrom:"; chomp (my $from = <STDIN>); print "\nSubject:"; chomp(my $subject = <STDIN>); print "\nContent (END to end):"; my $content; while (1) { my $line = <STDIN>; last if $line eq "END\n"; $content .= $line; } $mailer->open( { From => $from, To => \@to, Subject => $subject }); print $mailer $content; close($mailer);

Of course, one other thing you should consider is some data validation, but that's left as an exercise for the reader :)

Cheers,
Darren :)