title: KornShell (ksh) code to send attachments with mailx and uuencode?
body: <p>I need to attach a file with mailx but at the moment I am not having success.</p>
  
  <p><strong>Here's my code:</strong></p>
  
  <pre><code>subject="Something happened"
  to="somebody@somewhere.com"
  body="Attachment Test"
  attachment=/path/to/somefile.csv
  
  uuencode $attachment | mailx -s "$subject" "$to" &lt;&lt; EOF
  
  The message is ready to be sent with the following file or link attachments:
  
  somefile.csv
  
  Note: To protect against computer viruses, e-mail programs may prevent
  sending or receiving certain types of file attachments.  Check your
  e-mail security settings to determine how attachments are handled.
  
  EOF
  </code></pre>
  
  <p>Any feedback would be highly appreciated.</p>
  
  <hr>
  
  <p><strong>Update</strong>
  I have added the attachment var to avoid having to use the path every time.</p>