#!/usr/bin/perl -w
#
# small program to illustrate the usage of MIME::Lite
#

use strict;
use MIME::Lite

# our mail server
my $mailserver = 'mail.globaldataguard.com';

# info
my $mimeh = MIME::Lite->new(
         From    => 'scc@globaldataguard.com',
         To      => 'knewman@globaldataguard.com, kurt@lamer.org',
         Subject => "Test program",
         Type    => 'multipart/mixed',
      );

# body of email
$mimeh->attach(
         Type => 'text/plain',
         Data => 'Content of message',
      );

# file attachment
$mimeh->attach(
         Type => 'application/vnd.ms-excel',
         Path => '/tmp/excelfile.xls',
         Filename => 'excelfile.xls',
         Disposition => 'attachment',
      );

# send it out
$mimeh->send('smtp', $mailserver, Timeout => 60) or
   die "Error: Couldn't send mail";

0;

