You can send email from Perl using the following code:
use Email::Send;
my $mailer = Email::Send->new( {
mailer => 'SMTP::TLS',
mailer_args => [
Host => 'smtp.gmail.com',
Port => 587,
User => 'username@gmail.com',
Password => 'password',
Hello => 'fayland.org',
]
} );
use Email::Simple::Creator; # or other Email::
my $email = Email::Simple->create(
header => [
From => 'username@gmail.com',
To => 'to@mail.com',
Subject => 'Subject title',
],
body => 'Content.',
);
eval { $mailer->send($email) };
die "Error sending email: $@" if $@;