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"); #==========================================================================