Hello Leo,
see my comments on your code below.
On Wed, 26 Sep 2012 09:52:55 -0700
Leo Susanto wrote:
> Basic script for gmail with subject:
>
> use strict;
You should also use "use warnings;".
> use Net::SMTP::TLS;
> our $MAIL;
Why "our" instead of "my"? And why is "$MAIL"
Basic script for gmail with subject:
use strict;
use Net::SMTP::TLS;
our $MAIL;
do "mail.conf";
my $mailer = new Net::SMTP::TLS(
$$MAIL{'Host'},
Hello => $$MAIL{'Hello'},
Port=> $$MAIL{'Port'},
<< how would you like to generate the data section in the message?>>
I checked the link you kindly sent me, and I actually used it in my example.
So, I can put in my script :
$my_email_body= "
then
$mailer->datasend("$my_email_body ");
On Wed, Sep 26, 2012 at 5:51 PM, Shlomi Fish wrot
Hi Samir,
please avoid replying to me in private (as I specifically request in my
signature), and instead reply to the list. I am now replying to the list.
You should also avoid top-posting, which makes your messages hard to follow:
http://en.wikipedia.org/wiki/Posting_style
I am going to reply
Hi Samir,
a few comments on your code:
On Wed, 26 Sep 2012 14:29:15 +0200
Samir Arishy wrote:
> This code is working.
>
1. Add "use strict;" and "use warnings;".
> use Net::SMTP::TLS;
> my $mailer = new Net::SMTP::TLS(
> 'smtp.gmail.com',
> Hello => 'smtp.gmail.com',
> Port=>
This code is working.
use Net::SMTP::TLS;
my $mailer = new Net::SMTP::TLS(
'smtp.gmail.com',
Hello => 'smtp.gmail.com',
Port=> 587,
User=> 'amyID',
Password=> 'myPW');
$a="data from some calculation inside the script.";
$mailer->mail('x...@y.com');
$mailer->to(