title: How to send html body and plain attachment with perl Net::SMTP
body: <p>besides there is Mime:Lite etc. I have no other possibility to use Net::SMTP.</p>
  
  <p>I am trying to send an email containing html message part and also an attachment containing text. I guess something is not in the right order or mime format may be incorrect?</p>
  
  <p>I can get the attachment with the content but no message in the email body is displayed:</p>
  
  <pre><code> $smtp-&gt;data();
   $smtp-&gt;datasend("Subject: ".$self-&gt;{SUBJECT}."\n");
   $smtp-&gt;datasend("To: ".@{$self-&gt;{TO}}[0]."\n");
   $smtp-&gt;datasend("From: ".$self-&gt;{FROM}."\n");
   $smtp-&gt;datasend("MIME-Version: 1.0\n");
   $smtp-&gt;datasend("Content-Type: multipart/mixed; boundary=\"frontier\"\n");
   $smtp-&gt;datasend("\n--frontier\n");
   $smtp-&gt;datasend("Content-Type: text/html; charset=\"UTF-8\" \n");
   $smtp-&gt;datasend("&lt;h3&gt;".$self-&gt;{BODY}."&lt;\/h3&gt;");
   $smtp-&gt;datasend("\n");
   $smtp-&gt;datasend("--frontier\n");
   $smtp-&gt;datasend("Content-Type: application/text; name= traps.txt \n");
   $smtp-&gt;datasend("Content-Disposition: attachment; filename=\"traps.txt\"\n");
   $smtp-&gt;datasend("\n");
   $smtp-&gt;datasend($self-&gt;{BODY});
   $smtp-&gt;datasend("\n");
   $smtp-&gt;datasend("--frontier\n");
   $smtp-&gt;dataend();
   $smtp-&gt;quit;
  </code></pre>