When I run this, it sends the message fine, but when I open the message in Outlook it shows the raw HTML instead of recognizing it as HTML. Here are the relevant header fields from the mail client (with some info starred out to protect the innocent, namely me):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=\"$bou +ndary\"" ); my $plain = encode_qp $text; $html = encode_entities($html); $boundary = '--'.$boundary; $mail{body} = <<END_OF_BODY; $boundary Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable $plain $boundary Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable $html $boundary-- END_OF_BODY sendmail(%mail) || die "Error: $Mail::Sendmail::error\n"; return; }
Anybody know what's going wrong here?Return-path: <info@*****.org> 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
Steve
In reply to Mail::Sendmail Multipart MIME isn't working by cormanaz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |