sub sendmessage {
my ($html,$text,$recipient,$reportdate) = @_;
my $boundary = "====" . time() . "====";
my %mail = (
from => 'foo@bar.org',
to => $recipient,
subject => "A message from me",
'content-type' => "multipart/alternative; boundary=\"$boundary\""
);
my $plain = encode_qp $text;
$html = encode_entities($html);
$boundary = '--'.$boundary;
$mail{body} = <##
Return-path:
Envelope-to: corman@*****.com
Subject: A message from me
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary="====1214608857===="
To: corman@*****.com
Date: Fri, 27 Jun 2008 17:20:57 -0600
From: info@*****.org