I found a small example as below and tried.
- #!/usr/bin/perl
-
-
my $to='xyz@hotmail.com';
-
my $from='xyz@hotmail.com';
-
my $subject='Low Disk Space';
-
-
# send email using UNIX/Linux sendmail
-
open(MAIL, "|/usr/sbin/sendmail -t");
-
my $out = "testing";
-
-
-
## Mail Header
-
print MAIL "To: $to\\n";
-
print MAIL "From: $from\\n";
-
print MAIL "Subject: $subject\\n";
-
-
## Mail Body
-
print MAIL $out;
-
-
close(MAIL);
When I execute the code, I get a message as below:
-
No recipient addresses found in header
How to resolve? Can't I use any public domains like hotmail etc.. or do I have to set up anything in my linux server. Please let me know. Thanks.