gpt4 book ai didi

linux - 从 Linux shell 发送邮件的格式不正确

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:45:54 26 4
gpt4 key购买 nike

我的文件格式如下:

cat myfile.txt

Size of user01 is 1863 MB, it over than 100 MB
Size of user02 is 1863 MB, it over than 100 MB
Size of user03 is 815 MB, it over than 100 MB

但是如果我把它邮寄到我的邮箱,

cat ./myfile.txt | mail -s "This is test Mail" myemail@domain.com

格式如下:

Size of user01 is 1863 MB, it over than 100 MB Size of user02 is 1863 MB, it over than 100 MB Size of user03 is 815 MB, it over than 100 MB

发送文件内容到邮箱时,如何保持原来的格式!?

最佳答案

您可以尝试使用内容类型为 html 的邮件命令并使用 html pre 标记来获取它。

echo "<pre>`cat myfile.txt`</pre>" | mail -a "Content-type: text/html" -s "This is test Mail" myemail@domain.com

关于linux - 从 Linux shell 发送邮件的格式不正确,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37199671/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com