使用Unix发送带有附件的电子邮件 [英] send email with attachment using Unix

查看:70
本文介绍了使用Unix发送带有附件的电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用以下脚本从Unix服务器发送电子邮件.我需要附加一个文件,该文件位于可以使用脚本的同一位置-/home/app111/attachment.csv.

I am using the following script to send an email from Unix sever. I have a requirement to attach a file which is at the same location where script is available - /home/app111/attachment.csv.

能否请您帮我发送附件中的文件?

Could you please help me how to send the file in attachment?

`CUR_DATE=`date +%Y/%m/%d`
echo $CUR_DATE
awk ' BEGIN {
print "To: XXXX@gmail.com"
print "From: YYYY@gmail.com" 
print "MIME-Version: 1.0"
print "Content-Type: text/html"
print "Subject: PO file '$CUR_DATE'"
print "<html><body><font face="Times New Roman" size="10">Hi All,<br></br>
<br>Please load the attached PO file</br><br/>"
print "<br>Thanks,</br></font></body></html>"
} ' | sendmail -t`

推荐答案

1

如果支持mailx -a功能,请使用 mailx -a

Using mailx -a if mailx -a feature is supported

2

使用 uuencode filenm filenm |mailx s@abc.com

3 mutt -a filenm a@abc.com

这篇关于使用Unix发送带有附件的电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆