G
Guru03
Hi, I must prepare an email with header, body and an attachment.
The header is on a text file "head.txt".
my $miment = MIME::Entity -> new ();
my $mimhead = MIME::Head->from_file ("head.txt") || die "error";
$miment -> head ($mimhead); # puts the MIME::Head into MIME::Entity
my $mbody = new MIME::Entity->build(Data => "ciao",
Type => "text/plain",
Encoding => "quoted-printable",);
$miment -> add_part ($mbody); # puts the MIME::Body into MIME::Entity
$miment -> attach (Data => "blabla", # adds the attachment
Type => 'application/xml');
$miment -> print;
the result is:
Date: Tue, 21 Oct 2003 13:41:19 +0200 (ora legale Europa occidentale)
From: Guru03
To: Guru04
Subject: test email
MIME-Version: 1.0
Content-type: multipart/mixed; boundary="----------=_1075373658-1352-0"
This is a multi-part message in MIME format...
------------=_1075373658-1352-0
Content-Type: text/plain
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-Mailer: MIME-tools 5.411 (Entity 5.404)
ciao
------------=_1075373658-1352-0
Content-Type: application/xml
Content-Disposition: inline
Content-Transfer-Encoding: base64
YmxhYmxhCmV3cXdlcQp3cWV3cWV3cWU=
------------=_1075373658-1352-0--
The body pard is invalid... that fields above "ciao" (from Content-Type
to X-Mailer) should NOT be shown.
How can I do? I'm getting to be fool...
The header is on a text file "head.txt".
my $miment = MIME::Entity -> new ();
my $mimhead = MIME::Head->from_file ("head.txt") || die "error";
$miment -> head ($mimhead); # puts the MIME::Head into MIME::Entity
my $mbody = new MIME::Entity->build(Data => "ciao",
Type => "text/plain",
Encoding => "quoted-printable",);
$miment -> add_part ($mbody); # puts the MIME::Body into MIME::Entity
$miment -> attach (Data => "blabla", # adds the attachment
Type => 'application/xml');
$miment -> print;
the result is:
Date: Tue, 21 Oct 2003 13:41:19 +0200 (ora legale Europa occidentale)
From: Guru03
To: Guru04
Subject: test email
MIME-Version: 1.0
Content-type: multipart/mixed; boundary="----------=_1075373658-1352-0"
This is a multi-part message in MIME format...
------------=_1075373658-1352-0
Content-Type: text/plain
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-Mailer: MIME-tools 5.411 (Entity 5.404)
ciao
------------=_1075373658-1352-0
Content-Type: application/xml
Content-Disposition: inline
Content-Transfer-Encoding: base64
YmxhYmxhCmV3cXdlcQp3cWV3cWV3cWU=
------------=_1075373658-1352-0--
The body pard is invalid... that fields above "ciao" (from Content-Type
to X-Mailer) should NOT be shown.
How can I do? I'm getting to be fool...