A
amerar
Hi All,
I have a Perl script that uses NET::SMTP to send out emails. I've
attached a snippet of my code below.
I want to also attach a file to this. I see lots of posts on using
MIME::LITE, however, I am not understanding how it will work with
NET::SMTP.
Can anyone help, maybe provide some examples?
Thanks in advance, and here is an example of my code:
$smtp = Net::SMTP->new("nitelife");
$smtp->mail($from);
$smtp->to($to);
$smtp->data();
$smtp->datasend("From: $from1\n");
$smtp->datasend("To: $to1\n");
$smtp->datasend("Subject: $subject\n");
$smtp->datasend("Mime-Version: 1.0\n");
$smtp->datasend("Content-Type: text/html; charset=us-ascii\n");
$smtp->datasend("Content-Disposition: inline\n");
$smtp->datasend("Content-Transfer-Encoding: 7bit\n");
$smtp->datasend("\n");
$smtp->datasend("<br><br>\n\n");
$smtp->datasend("Text goes here......\n");
$smtp->datasend("Text goes here......\n");
..
..
$smtp->dataend();
$smtp->quit;
Arthur
I have a Perl script that uses NET::SMTP to send out emails. I've
attached a snippet of my code below.
I want to also attach a file to this. I see lots of posts on using
MIME::LITE, however, I am not understanding how it will work with
NET::SMTP.
Can anyone help, maybe provide some examples?
Thanks in advance, and here is an example of my code:
$smtp = Net::SMTP->new("nitelife");
$smtp->mail($from);
$smtp->to($to);
$smtp->data();
$smtp->datasend("From: $from1\n");
$smtp->datasend("To: $to1\n");
$smtp->datasend("Subject: $subject\n");
$smtp->datasend("Mime-Version: 1.0\n");
$smtp->datasend("Content-Type: text/html; charset=us-ascii\n");
$smtp->datasend("Content-Disposition: inline\n");
$smtp->datasend("Content-Transfer-Encoding: 7bit\n");
$smtp->datasend("\n");
$smtp->datasend("<br><br>\n\n");
$smtp->datasend("Text goes here......\n");
$smtp->datasend("Text goes here......\n");
..
..
$smtp->dataend();
$smtp->quit;
Arthur