title: How to send using with attachment and html body using mailx
body: <p>I want to send an e-mail using mailx which has an attachment and HTML code on the body.
  Setting the Content-type to "text/html" mail comes with file binary content on the body instead of attached.</p>
  
  <pre><code>echo "" &gt;&gt; $MAILFILE
  echo "&lt;HTML&gt;" &gt;&gt; $MAILFILE
  echo "&lt;HEAD&gt;" &gt;&gt; $MAILFILE
  echo "&lt;/HEAD&gt;" &gt;&gt; $MAILFILE
  echo "&lt;BODY&gt;" &gt;&gt; $MAILFILE
  echo "&lt;table border="1"&gt;" &gt;&gt;$MAILFILE
  echo "&lt;tr bgcolor=#C0C0C0&gt;" &gt;&gt;$MAILFILE
  echo "&lt;td&gt;&lt;b&gt;OUTAGE&lt;/b&gt;&lt;/td&gt;" &gt;&gt;$MAILFILE
  echo "&lt;td&gt;$OUTAGE_COUNT&lt;/td&gt;" &gt;&gt;$MAILFILE
  echo "&lt;/tr&gt; &lt;/table&gt;&lt;br&gt;" &gt;&gt;$MAILFILE
  echo "&lt;/table&gt;" &gt;&gt; $MAILFILE
  echo "&lt;/BODY&gt;&lt;/HTML&gt;" &gt;&gt; $MAILFILE
  
  (uuencode outage.zip outage.zip;cat $MAILFILE) | mailx -s "Outage Payments Status
  Content-type: text/html" $distro -- -f ${EMAIL_FROM}
  </code></pre>
  
  <p>Result - Body's email:</p>
  
  <pre><code>begin 644 outage.zip M4$L#!!0````(`,:$(T5RYN"0#P```.D#```3`!4`;W5T86=E7W!A&gt;6UE;G1S M+F-S=E54"0`#)&amp;X'5"1N!U15&gt;`0`.GX1@5-0@`(3A5$P"D;!,`5&lt;&amp;%Y;65N=',N8W-V550%``,D;@=457@``%!+!08``````0`!`$X```!5 %```````` ` end 
  </code></pre>