sendmail发送html邮件,如何发送与bash命令“sendmail的”一个HTML电子邮件?(How to send a ht...

任何人有一个试用?

Sendmail的据说是不可扩展,但它是免费的,所以我决定先用它现在:)

Answer 1:

我不能让任何发布的解决方案的工作,但最后发现这在其他地方,和它的伟大工程:

(

echo "From: ${from}";

echo "To: ${to}";

echo "Subject: ${subject}";

echo "Content-Type: text/html";

echo "MIME-Version: 1.0";

echo "";

echo "${message}";

) | sendmail -t

Answer 2:

如果我理解正确的话,你想使用Linux sendmail命令以HTML格式发送邮件。 此代码工作在Unix。 请试一试。

echo "From: me@xyz.com

To: them@xyz.com

MIME-Version: 1.0

Content-Type: multipart/alternative;

boundary='PAA08673.1018277622/server.xyz.com'

Subject: Test HTML e-mail.

This is a MIME-encapsulated message

--PAA08673.1018277622/server.xyz.com

Content-Type: text/html

HTML E-mail

Click Here

--PAA08673.1018277622/server.xyz.com

" | sendmail -t

对于sendmail配置的详细信息,请参阅此链接 。 希望这可以帮助。

Answer 3:

This page should help - http://www.zedwood.com/article/103/bash-send-mail-with-an-attachment

It includes a script to send e-mail with a MIME attachment, ie with a HTML page and images included.

Answer 4:

我明白你问的sendmail,但为什么不使用默认的邮件 ? 它可以轻松地发送HTML格式的电子邮件。

适用于:RHEL 5.10 / 6.x中和的CentOS 5.8

例:

cat ~/campaigns/release-status.html | mail -s "$(echo -e "Release Status [Green]\nContent-Type: text/html")" to.address@company.com -v

代码共享: http://www.codeshare.io/8udx5

Answer 5:

要使用跟进以前的答案邮件 :

很多时候,一个人的HTML输出是由客户端邮件程序,这可能不是格式化使用固定宽度的字体事物解释。 因此,你的很好的格式化的ASCII Alignment获取全乱了。 送老式的固定宽度的上帝希望的方式,试试这个:

{ echo -e "

"

echo "Descriptive text here."

shell_command_1_here

another_shell_command

cat <

This is the ending text.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值