小编Dar*_*rio的帖子

Shell脚本使用sendmail嵌入多个图像

我正在使用以下脚本使用sendmail功能在邮件上嵌入多个图像.

sendmail -t <<EOT
TO: example_to@xyz.com
FROM: example_from@xyz.com
Cc: example_cc@xyz.com
SUBJECT: Phobos Report 
MIME-Version: 1.0
Content-Type: multipart/related;boundary="XYZ"

--XYZ
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 7bit

<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-15">
</head>
<body bgcolor="#ffffff" text="#000000">
<img src="cid:part1.06090408.01060107" alt=""><br/>
<img src="cid:part2.06090408.01060107" alt=""><br/>
<img src="cid:part3.06090408.01060107" alt="">
</body>
</html>

--XYZ
Content-Type: image/jpeg;name="rag1.jpg"
Content-Transfer-Encoding: base64
Content-ID: <part1.06090408.01060107>
Content-Disposition: inline; filename="rag1.jpg"

$(base64 rag1.jpg)

--XYZ

Content-Type: image/jpeg;name="rag2.jpg"
Content-Transfer-Encoding: base64
Content-ID: <part2.06090408.01060107>
Content-Disposition: inline; filename="rag2.jpg"

$(base64 rag2.jpg)

--XYZ

Content-Type: image/jpeg;name="rag3.jpg"
Content-Transfer-Encoding: base64
Content-ID: <part3.06090408.01060107>
Content-Disposition: inline; filename="rag3.jpg"

$(base64 rag3.jpg) …
Run Code Online (Sandbox Code Playgroud)

unix linux shell mime sendmail

5
推荐指数
1
解决办法
1096
查看次数

标签 统计

linux ×1

mime ×1

sendmail ×1

shell ×1

unix ×1