Hi All,

I am a beginner of perl and sorry if I am asking something silly.
I have written the following code using some pre-made scripts on net.


#!/usr/bin/perl
l1:print"Enter your E-Mail ID";
   my $from=<STDIN>;

l2:print"Enter receipt's E-Mail ID";
   my $to=<STDIN>;

   print"Enter Subject";
   my $sub=<STDIN>;

   print"Enter Body";
   my $body=<STDIN>;



open (MAIL,"|/usr/sbin/sendmail");
print MAIL "To: $to\n";
print MAIL "From: $from\n";
print MAIL "Subject: $sub\n\n";
print MAIL "$body\n";
close MAIL;



However it gives an error on running in Bash shell as "Recipient names
must be specified".
I am not able to figure out what could be the source of error.

I have also read the previous posts on it but couldn't find the
answer.

And I also want to know that can we give any email ID in from
field .If yes then how is it possible that one can send an email from
anyone's account without the need of opening it with a password

Sorry again if something is childish and Thanks in advance.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to