Then create a Perl script called mail-send.pl containing the following code:
#!/usr/bin/perl
usestrict;
uselibqw(/home/redanti/perl);
useMail::Send;
my$msg = new Mail::Send;
$msg->to('kuuse@redantigua.com');
$msg->subject('Mail::Send test');
# Launch mailer and set headers.# The filehandle returned by open() is an instance of the Mail::Mailer class.
my$fh = $msg->open;
print $fh "This is the body of the message\nByeBye";
$fh->close; # complete the message and send it
and send your mail:
# perl -w mail-send.pl
Check your mail to verify that the mail was sent correctly.
If you want to use Perl to check your mail, read the Mail::POP3Client tutorial.
Read more:
If you want a more sophisticated solutions, I strongly recommend these two: