title: Send mail in html format from perl script
body: <p>I am working on unix environment and have a perl scrip to send mail, but i need to send HTML formatted mail,but it printing as it is html code. so could anyone please let me know how it manipulate or compile the html and send formatted mail.</p>
  
  <pre><code>#!/usr/bin/perl
  #print "Content-type: text/html\n\n";
  
  print("enter my name");
  chop($name=&lt;stdin&gt;);
  &amp;mail();
  
  
  sub mail{
  
  $title='perl';
  $to='abcd@acv.com';
  $from= 'xyz@xyz.com';
  $subject=$name;
  
  open(MAIL, "|/usr/sbin/sendmail -t");
  
  ## Mail Header
  print MAIL "To: $to\n";
  print MAIL "From: $from\n";
  print MAIL "Subject: $subject\n\n";
  ## Mail Body
  print MAIL $name;
  print MAIL "&lt;html&gt;&lt;body&gt;&lt;p&gt;";
  print MAIL "&lt;b&gt;Hello&lt;/b&gt;";
  print MAIL "This is a test message from Cyberciti.biz! You can write your";
  
  print MAIL "&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;";
  ##print MAIL "$title";
  close(MAIL);
  }
  </code></pre>
  
  <p>Its printing in mail:</p>
  
  <pre><code>&lt;html&gt;&lt;body&gt;&lt;p&gt;&lt;b&gt;Hello&lt;/b&gt;This is a test message from Cyberciti.biz! You can write your&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;
  </code></pre>
  
  <p>like this...as it is seems its not converting it into html format.
  So please help me over this.</p>