Problem with MIME::Entity

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...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,705
Latest member
Stefkari24

Latest Threads

Top