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} = <