Problem with MIME::Entity

Discussion in 'Perl Misc' started by Guru03, Jan 29, 2004.

  1. Guru03

    Guru03 Guest

    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...
     
    Guru03, Jan 29, 2004
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. CJ
    Replies:
    1
    Views:
    1,574
    Andrew Thompson
    Oct 29, 2004
  2. markla
    Replies:
    1
    Views:
    549
    Steven Cheng
    Oct 6, 2008
  3. ThatsIT.net.au

    Entity, problem with entity key

    ThatsIT.net.au, Sep 6, 2009, in forum: ASP .Net
    Replies:
    1
    Views:
    1,202
    ThatsIT.net.au
    Sep 7, 2009
  4. Jan Arickx
    Replies:
    0
    Views:
    202
    Jan Arickx
    Aug 25, 2003
  5. ecureuil
    Replies:
    0
    Views:
    327
    ecureuil
    May 28, 2006
Loading...

Share This Page