#!/usr/bin/perl
use MIME::Lite;
 

$path = "/ptmp/charts/".$ARGV[1];

$msg = MIME::Lite->new(From    => 'PhysioNet',
                       To      => $ARGV[0],
                       Subject => 'chart',
                       Type    => 'multipart/mixed');
$msg->attach(Type        => 'TEXT',
             Data        => 'Here is the chart you requested.');

$msg->attach(Type   => 'image/png',
	     Path   => $path,
             Filename   => $ARGV[1],
	     Disposition => 'attachment');

$msg->send(  );            # default is to use sendmail(1)
# alternatively
$msg->send('smtp', 'localhost');
