title: Send e-mail with multiple attachments using command line and sendmail
body: <p>Is it possible to send multiple attachments with <code>uuencode</code> and <code>sendmail</code>?</p>
  
  <p>In a script I have a variable containing the files that need to be attached to a single e-mail like:</p>
  
  <pre><code>$attachments=attachment_1.pdf attachment_2.pdf attachment_3.pdf attachment_4.pdf
  </code></pre>
  
  <p>Also a <code>$template</code> variable like:</p>
  
  <pre><code>$template="Subject: This is the subject
  From: no-reply@domain.com
  To: %s
  Content-Type: text/plain
  
  This is the body.
  "
  </code></pre>
  
  <p>I have come up with:</p>
  
  <pre><code>printf "$template" "$recipient" |
  sendmail -oi -t
  </code></pre>
  
  <p>Somewhere within this I must attach everything in the <code>$attachments</code> variable?</p>