Thread MIME::Entity problem mit multipart mails (1 answers)
Opened by kajax01 at 2009-04-08 13:45

kajax01
 2009-04-08 13:45
#120389 #120389
User since
2009-04-06
6 Artikel
BenutzerIn
[default_avatar]
Hallo,

Weiß zufällig jemand wie man eine multipart mail richtig zusammensetzt?
Bei dem untenstehenden Code wird alles als attachment behandelt, trotz
disposition => "inline".

Danke
Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use MIME::Entity;
#==========================================================================
   ### Create the top-level, and set up the mail headers:
    $top = MIME::Entity->build(Type     => "multipart/mixed",
                               From     => 'sender@domain.example',
                               To       => 'recipient@domain.example',
                               Path     => $body_path,
                               Subject  => "MIME Test + attachment");
    $body_path = "/home/jk/cpe/nachricht.txt";
    $att_1_path = "/home/jk/cpe/libnet-1.22.tar";
    ### Attachment #1: a simple text document:
    $top->attach(Path=>$body_path,
                 Type=>"Text/plain",
                 Encoding=>"quoted-printable",
                 Disposition  =>  'inline');
    ### Attachment #1: a simple text document:
    $top->attach(Path=>$att_1_path,
                 Type=>"Application/X-tar",
                 Disposition=>"attach",
                 Encoding=>"base64");
    $top->dump_skeleton(\*STDERR);
    $top->smtpsend(host=>"localhost");
#==========================================================================

debug-output:
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Content-type: multipart/mixed
Effective-type: multipart/mixed
Body-file: NONE <============================
Subject: MIME Test + attachment
Num-parts: 2
--
Content-type: text/plain
Effective-type: text/plain
Body-file: /home/jk/cpe/nachricht.txt
Recommended-filename: nachricht.txt
--
Content-type: application/x-tar
Effective-type: application/x-tar
Body-file: /home/jk/cpe/libnet-1.22.tar
Recommended-filename: libnet-1.22.tar
--


mod-edit pq: email-adressen durch beispieladressen ausgetauscht (siehe FAQ zu Email Adressen im Posting)

mod-edit pq: code-tags hinzugefügt
Last edited: 2009-04-08 13:59:40 +0200 (CEST)

View full thread MIME::Entity problem mit multipart mails