qwurx [shmem] ~> perl -MMIME::Lite -le '$m=MIME::Lite->new(Data=>"foo");$m->print'
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
MIME-Version: 1.0
X-Mailer: MIME::Lite 3.030 (F2.85; T2.09; A2.13; B3.14; Q3.13)
Date: Sun, 30 Jul 2017 02:30:09 +0200
foo
####
qwurx [shmem] ~> perl -MMIME::Lite -le '$m=MIME::Lite->new;$m->build(from => "me", to =>"you", Data => "kisses"); $m->print'
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
MIME-Version: 1.0
X-Mailer: MIME::Lite 3.030 (F2.85; T2.09; A2.13; B3.14; Q3.13)
Date: Sun, 30 Jul 2017 02:32:39 +0200
From: me
To: you
kisses
####
use MIME::Lite;
$m = MIME::Lite->new;
$m->build(
from => 'me',
to => 'you',
Data => '',
subject => 'Foo Bar',
);
$m->attach(
Type => 'text/plain',
Data => 'this is an attachment'
);
$m->print;
__END__
Content-Transfer-Encoding: 7bit
Content-Type: multipart/mixed; boundary="_----------=_150137533476690"
MIME-Version: 1.0
Date: Sun, 30 Jul 2017 02:42:14 +0200
From: me
To: you
Subject: Foo Bar
X-Mailer: MIME::Lite 3.030 (F2.85; T2.09; A2.13; B3.14; Q3.13)
This is a multi-part message in MIME format.
--_----------=_150137533476690
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
--_----------=_150137533476690
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
this is an attachment
--_----------=_150137533476690--
####
$msg->attach(
Type => 'text/plain',
Data => 'This is the body text of the email',
);