Advertisement
pouar

examplemail.sh

Feb 15th, 2016
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.27 KB | None | 0 0
  1. #!/bin/bash
  2. boundry1=$(cat /dev/random|tr -cd '[:alnum:]'|head -c 20)
  3. id2=$(cat /dev/random|tr -cd '[:digit:]'|head -c 20)
  4. boundry2=$(cat /dev/random|tr -cd '[:alnum:]'|head -c 20)
  5. sendmail -t <<EOT
  6. FROM: This guy <[email protected]>
  7. TO: That guy <[email protected]>
  8. SUBJECT: Test
  9. MIME-Version: 1.0
  10. Content-Type: multipart/mixed;
  11.  boundary="${boundry1}"
  12.  
  13. This is a multi-part message in MIME format.
  14. --${boundry1}
  15. Content-Type: multipart/related;
  16.  boundary="${boundry2}"
  17.  
  18.  
  19. --${boundry2}
  20. Content-Type: text/html; charset=utf-8
  21. Content-Transfer-Encoding: 7bit
  22.  
  23. <html>
  24. <head>
  25. <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  26. </head>
  27. <body bgcolor="#ffffff" text="#000000">
  28. <img src="cid:${id2}" alt="">
  29. </body>
  30. </html>
  31.  
  32. --${boundry2}
  33. Content-Type: image/png;
  34.  name="diapericonblank.png"
  35. Content-Transfer-Encoding: base64
  36. Content-ID: <${id2}>
  37. Content-Disposition: inline;
  38.  filename="diapericonblank.png"
  39.  
  40. $(base64 /home/pouar/Pictures/diapericonblank.png)
  41. --${boundry2}--
  42.  
  43. --${boundry1}
  44. Content-Type: application/x-lzma;
  45.  name="diapericoncde.pm.lzma"
  46. Content-Transfer-Encoding: base64
  47. Content-Disposition: attachment;
  48.  filename="diapericoncde.pm.lzma"
  49.  
  50. $(base64 /home/pouar/Pictures/diapericoncde.pm.lzma)
  51. --${boundry1}--
  52.  
  53.  
  54. EOT
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement