ytjPerl has asked for the wisdom of the Perl Monks concerning the following question:
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
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Mail::Sendmail Module
by toolic (Bishop) on Feb 26, 2018 at 15:23 UTC | |
by ytjPerl (Scribe) on Feb 26, 2018 at 15:56 UTC | |
by Laurent_R (Canon) on Feb 26, 2018 at 18:43 UTC | |
by ytjPerl (Scribe) on Feb 27, 2018 at 18:30 UTC | |
by Laurent_R (Canon) on Feb 27, 2018 at 22:54 UTC | |
Re: Mail::Sendmail Module
by hippo (Archbishop) on Feb 26, 2018 at 16:19 UTC | |
by toolic (Bishop) on Feb 26, 2018 at 19:07 UTC | |
by hippo (Archbishop) on Feb 26, 2018 at 22:16 UTC | |
by ytjPerl (Scribe) on Feb 26, 2018 at 16:29 UTC | |
by poj (Abbot) on Feb 26, 2018 at 17:07 UTC |