title: sending html email in perl not working
body: <p>Below is the perl code I used to send HTML email:</p>
  
  <pre><code>#!/usr/bin/perl
  use strict;
  use warnings;
  use Switch;
  use IO::File;
  
  my $score = 2;
  my $to = 'abc@a.com';
  my $from = 'def@b.com';
  my $subject = "SHV summary report for servers with score $score or higher";
  my $mailbody = '&lt;html&gt;&lt;body&gt;Hello&lt;/body&gt;&lt;/html&gt;';
  open(MAIL,"|/usr/sbin/sendmail -t");
      print MAIL "To: $to\n";
      print MAIL "From: $from\n";
      print MAIL "Subject: $subject\n";
      print MAIL "Content-Type: text/html; charset=utf-8\n\n"
          . "$mailbody";
  
  close(MAIL);
  </code></pre>
  
  <p>It's not working. I receives no email.
  But if I replace the open () call with:</p>
  
  <p>open(MAIL,"|cat -t");</p>
  
  <p>It prints the following:</p>
  
  <pre><code>To: abc@a.com
  From: def@b.com
  Subject: SHV summary report for servers with score 2 or higher
  Content-Type: text/html; charset=utf-8
  
  &lt;html&gt;&lt;body&gt;Hello&lt;/body&gt;&lt;/html&gt;
  </code></pre>
  
  <p>if I replace:</p>
  
  <pre><code>my $subject = "SHV summary report for servers with score $score or higher";
  </code></pre>
  
  <p>with:</p>
  
  <pre><code>my $subject = "SHV summary report for servers with core $score";
  </code></pre>
  
  <p>then everything work fine. If I </p>
  
  <p>change "core" back to "score", or </p>
  
  <p>add "or higher" to the string, or </p>
  
  <p>change it to "SHV score $score or higher" </p>
  
  <p>it stop working. Anyone knows why?</p>
  
  <p>Thanks, 
  Alex</p>