Hello Guys,
I have the below codes for sending mail through gmail server. I do not have syntax error executing it. but it is not working as expected. Please point out my errors. thanks
#!/usr/bin/perl
use strict;
use warnings;
use Mail::Sendmail;
my %mail;
$mail{Smtp} = "smtp.gmail.com";
$mail{Debug} = 6;
$mail{Port} = 465;
$mail{Auth} = {user => "username", pass => "password",
method => "LOGIN", required => 1};
# set the recipients (to) address [REQUIRED]
$mail{To} = 'xxxxxxx@gmail.com';
# set the mail sender address [REQUIRED]
$mail{From} = 'xxxxxxx@gmail.com';
$mail{Sender} = 'xxxxxxx@gmail.com';
# set the mail subject line
$mail{subject} = "Test message";
# set the mail content
$mail{body} = "The test messsage is having this body line inside.";
# set the mail encoding type
$mail{'content-type'} = qq(text/plain; charset="utf-8");
2018-02-27 Athanasius fixed opening code tag and added paragraph tags