sub send_email { # # Code adapted from the Mail::Sendmail FAQ, located (at the time) at http://alma.ch/perl/Mail-Sendmail-FAQ.htm # my ( $server, $sender, $addressee, $reply_to, $subject, $msg ) = @_; use MIME::QuotedPrint; use HTML::Entities; use Mail::Sendmail 0.75; # doesn't work with v. 0.74! my ($plain); $boundary = "====" . time() . "===="; %mail = ( 'SMTP' => $server, 'from' => $sender, 'to' => $addressee, 'reply-to' => $reply_to, 'subject' => $subject, 'content-type' => "multipart/alternative; boundary=\"$boundary\"" ); # { # use HTML::TreeBuilder; # my $tree = HTML::TreeBuilder->new(); # empty tree # $tree->parse($msg); # $tree->eof(); # $plain = $tree->as_text . "\n"; # Now that we're done with it, we must destroy it. # $tree = $tree->delete; # } # { # use HTML::Parse; # $plain = parse_html($msg)->format; # } # $html = encode_entities($msg); # $html =~ s/\n\n/\n\n

/g; # $html =~ s/\n/
\n/g; # $html = "

" . $html . "

"; $boundary = '--' . $boundary; $mail{body} = <