0
我的目标是用HTML正文发送使用curl
一封电子邮件,其中嵌入的图像,例如:卷曲:发送HTML电子邮件与嵌入式图像和附件
我发送电子邮件这样的:
curl "smtp://smtp.gmail.com:587" -v \
--mail-from "[email protected]" \
--mail-rcpt "[email protected]" \
--ssl -u [email protected]:secretpassword \
-T "message.txt" -k --anyauth
我message.txt
样子:
From: Some Name <[email protected]>
To: Some Name <[email protected]>
Subject: example of mail
Reply-To: Some Name <[email protected]>
Cc:
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="MULTIPART-MIXED-BOUNDARY"
--MULTIPART-MIXED-BOUNDARY
Content-Type: multipart/alternative; boundary="MULTIPART-ALTERNATIVE-BOUNDARY"
--MULTIPART-ALTERNATIVE-BOUNDARY
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: base64
Content-Disposition: inline
PGh0bWw+Cjxib2R5PgogICAgPGRpdj4KICAgICAgICA8cD5IZWxsbywgPC9wPgogICAgICAgIDxw
PlBsZWFzZSBzZWUgdGhlIGxvZyBmaWxlIGF0dGFjaGVkPC9wPgogICAgICAgIDxwPkFkbWluIFRl
YW08L3A+CiAgICAgICAgPGltZyBzcmM9ImFkbWluLnBuZyIgd2lkdGg9IjE1MCIgaGVpZ2h0PSI1
MCI+CiAgICA8L2Rpdj4KPC9ib2R5Pgo8L2h0bWw+Cg==
--MULTIPART-ALTERNATIVE-BOUNDARY--
--MULTIPART-MIXED-BOUNDARY
的HTML解码是:
<html>
<body>
<div>
<p>Hello, </p>
<p>Please see the log file attached</p>
<p>Admin Team</p>
<img src="admin.png" width="150" height="50">
</div>
</body>
</html>
如何能够将在这个网站admin.png
和附加其他文件log.txt
使用curl
和bash
这封电子邮件吗?