I just want to know how to send e-mail from perl. I just tried the following code :
#! /usr/bin/perl -w
my ($to, $from, $subject, $message) = @_;
my $sendmail = '/usr/lib/sendmail';
open(MAIL, "|$sendmail -oi -t");
print MAIL "From: $from\n";
print MAIL "To: $to\n";
print MAIL "Subject: $subject\n\n";
print MAIL "$message\n";
&sendemail("email@example.com", "firstname.lastname@example.org", "Test perl mail",
+ "This is the test mail from perl");
it returned me the following errors:
Name "main::gmail" used only once: possible typo at ./mail.pl line 15.
Name "main::yahoo" used only once: possible typo at ./mail.pl line 15.
Pls help me...
Thanks in advance !!!