#!/usr/bin/perl

use MIME::Lite;
use strict;
use warnings;

my $from_address="gregoa\@localhost";
my $email="gregoa\@localhost";
my $subject="test";
my $message_body="body";
my $mail_host="localhost";
my $client_windows_src="/tmp/foo.zip";
my $client_windows="foo.zip";

my $msg = MIME::Lite->new (
  From => $from_address,
  To => $email,
  Subject => $subject,
  Type =>'multipart/mixed'
) or die "Error creating multipart container: $!\n";

$msg->attach (
  Type => 'TEXT',
  Data => $message_body
) or die "Error adding the text message part: $!\n";

$msg->attach (
  Type => 'application/zip',
  Path => $client_windows_src,
  Filename => $client_windows,
  Disposition => 'attachment'
) or die "Error adding $client_windows_src: $!\n";
                               
MIME::Lite->send('smtp', $mail_host, Timeout=>60);
$msg->send;
