一行指令 夾檔寄信(mail)

想要一行指令就把 file 夾在 mail 附件寄出的方法.

uuencode filename.zip Attachment.zip| mail -s "Subject" abc@domain

  • filename.zip : 要寄信的檔名
  • Attachment.zip: 收件者看到附件的名字
  • Subject: 信件標題
  • abc@domain: Email

若找不到 uuencode, 可: apt-get install sharutils