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('a...@b.com');
$mailer->data;
$mailer->datasend("this is coming from perl  $a ");  ###
$mailer->dataend;
$mailer->quit;

I need help in few ares:

1. Where I put the Subject: xxxxxxxxxxxx  ?  The email I recieved running
this script had no subject !!!!!
2. I really have more data in the script that I need to code into the body
of the email. I am showing a sample ($a)
3. What is the puropse of $mailer->data;
4. how to attach a file or a picture stored either locally or has a link??

I did a lot of research, on these questions, now is the time to ask for help

Reply via email to