方法一:发送单个附件(正文乱码)
mutt -s "mail subject" -a output_email.html -- tomail@163.com < output_email.html
或者
cat output_email.html | mutt -s "mail subject" -a output_email.html -- tomail@163.com
效果截图:
邮件正文乱码
方法二:发送多个附件(正文不乱码)
# !/bin/sh
from='yanggang@fruitsmobile.com'
to='yanggang_2050@163.com'
email_date=''
email_subject='subjest'
email_content="./folder/file"
email_attach="./folder/file ./folder/file2 ./folder/file3 ./folder/file4"
function send_email(){
email_date=$(date "+%Y-%m-%d_%H:%M:%S")
email_subject=$email_subject"__"$email_date
cat $email_content | /usr/bin/mutt -s $email_subject -a $email_attach -e 'set content_type="text/html"' -e 'my_hdr from:'$from -- $to
}
send_email
效果图:
推荐网站:
Sending files as mail attachments
Sending email with attachments on UNIX systems
Linux自动下发送HTML格式并带附件的邮件
分享到:
相关推荐
linux shell 发送email 邮件(shell脚本源码,含三种方法)
Linux shell发邮件如何才能同时发送邮件给多个人???这里揭晓答案
看上去有点复杂,其实就是sendmail程序从标准输入读取邮件源码,-t参数表示从邮件源码提取收件人信息,然后发送到收件人的邮件服务器,我们稍做整理,将邮件源码保存在email.txt中如下 To: handy1989@qq.com CC: ...
linux shell编程指南linux shell编程指南linux shell编程指南linux shell编程指南linux shell编程指南linux shell编程指南linux shell编程指南linux shell编程指南linux shell编程指南linux shell编程指南linux ...
Linuxshell大作业.pdf
LINUX SHELL命令练习 题
linux shell学习资料:Linux Shell从入门到精通、Linux Shell编程艺术、Linux Shell脚本攻略
Linux Shell Scripting Cookbook(3rd) 英文mobi 第3版 本资源转载自网络,如有侵权,请联系上传者或csdn删除 查看此书详细信息请在美国亚马逊官网搜索此书
Linux Shell脚本手册 - 第三版,. This book will take you through useful real-world recipes designed to make your daily life easier when working with the shell.
LinuxShell脚本编程实例.pdf
Linux Shell常用技巧Linux Shell常用技巧
linux shell 视频教学 轻松学习shell
linux shell 应用.chm,学习linux shell资料
Proper usage of shell commands can easily solve many complex tasks with a few lines of code, but most linux users don't have the right know-how to use the Linux shell to its full potential. ...
LinuxShell.pdf LinuxShell.pdf LinuxShell.pdf
Linux Shell实例精讲,大量实例shell,容易理解和实践
LinuxShell编程基础教程.pdf
本书由浅入深、循序渐进地详细讲解了LinuxShell编程的基本知识。这些基本知识包括Shell编程的基本知识、文本处理的工具和方法、正则表达式、Linux系统知识等。 本书旨在通过理清Linux Shell编程的脉络,从基本概念...