Advertisement
Guest User

Untitled

a guest
Apr 1st, 2017
918
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. echo "body" | mail -s "subject" my@email.com
  2.  
  3. uuencode /path/to/file file_name.ext | mail -s subject my@email.com
  4.  
  5. v_mailpart="$(uuidgen)/$(hostname)"
  6. echo "To: my@email.com
  7. Subject: subject
  8. Content-Type: multipart/mixed; boundary="$v_mailpart"
  9. MIME-Version: 1.0
  10.  
  11. This is a multi-part message in MIME format.
  12. --$v_mailpart
  13. Content-Type: text/html
  14. Content-Disposition: inline
  15.  
  16. <html><body>Message text itself.</body></html>
  17.  
  18. --$v_mailpart
  19. Content-Transfer-Encoding: base64
  20. Content-Type: application/octet-stream; name=file_name.ext
  21. Content-Disposition: attachment; filename=file_name.ext
  22.  
  23. `base64 /path/to/file`
  24. --$v_mailpart--" | /usr/sbin/sendmail -t
  25.  
  26. echo "body" | mutt -s "subject" -a attachment0 attachment1 [...] -- my@email.com
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement