title: mail command from bash script not sending attachment when using uuencode , mail body is html file
body: <p>I have written a script which makes a html table in mail body , I want to send a file/zip as attachment using mail command and uuencode but somehow its not working inside bash script but works from console .</p>
  
  <pre><code>mailbody="&lt;html&gt;&lt;table&gt;&lt;th&gt;&lt;tr&gt;&lt;td&gt;Name&lt;/td&gt;&lt;td&gt;Age&lt;/td&gt;&lt;/tr&gt;&lt;/th&gt;&lt;tr&gt;&lt;td&gt;\
             ABC&lt;/td&gt;&lt;td&gt;25&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/html&gt;"
  echo $mailbody&gt;&gt;mailer.txt
  #assume i have test.txt or test.zip which i need as attachment in mail
  #i tried below with html part as body
  uuencode test.txt test.txt|mail -s "Test mail\nContent-Type: text/html" "xyz.com" &lt;mailer.txt
  </code></pre>
  
  <p>this sends mail with mail body showing html Table but attachment is missing .</p>
  
  <pre><code>uuencode test.txt test.txt|mail -s "Test mail" "xyz.com"  properly send mail with test.txt as attachment but a plain mail , no html
  </code></pre>
  
  <p>thanks in advance</p>