sendmail 怎么才能发送data 和title

shenghuiping2001 2011-03-15 07:46:27
我使用命令: sendmail -s "hello" test@sheng.com
结果只有 收到 title 为hello 的邮件,我想邮件的正文也要有内容,是什么命令,还是要加什么参数,望做过的朋友看看。
...全文
65 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
shenghuiping2001 2011-03-16
  • 打赏
  • 举报
回复
[Quote=引用 5 楼 steptodream 的回复:]
引用 4 楼 shenghuiping2001 的回复:

有问题,结果是: root 发的信, 没有收件人,内容显示了,应该肯定的是title 没有作用,
test@sheng.com 是有作用了,要不然test@sheng 的邮箱收不到邮件,我再看看。

你直接用mail命令不行吗
echo "hello content" | mail -s "hello" test@shen……
[/Quote]
非常感谢主席,我还有很多要向你学习,给分。
steptodream 2011-03-15
  • 打赏
  • 举报
回复
[Quote=引用 4 楼 shenghuiping2001 的回复:]

有问题,结果是: root 发的信, 没有收件人,内容显示了,应该肯定的是title 没有作用,
test@sheng.com 是有作用了,要不然test@sheng 的邮箱收不到邮件,我再看看。
[/Quote]
你直接用mail命令不行吗
echo "hello content" | mail -s "hello" test@sheng.com
cat mail | mail -s "hello" test@sheng.com

还有你完全可以把标题这些信息写到mail里 标准的mail都有格式的 比如
Subject:hello
From:xxx@xxx.com
To:xxx@xxxx.com
this is a test mail

为了使邮件格式看上去更合法 你可以加跟多的元素
shenghuiping2001 2011-03-15
  • 打赏
  • 举报
回复
有问题,结果是: root 发的信, 没有收件人,内容显示了,应该肯定的是title 没有作用,
test@sheng.com 是有作用了,要不然test@sheng 的邮箱收不到邮件,我再看看。
freetstar 2011-03-15
  • 打赏
  • 举报
回复
用重定向哀< `cat file`
steptodream 2011-03-15
  • 打赏
  • 举报
回复
sendmail -s "hello" test@sheng.com < mail
也应该可以 你可以试试 我有点忘记了
steptodream 2011-03-15
  • 打赏
  • 举报
回复
echo "hello content" | sendmail -s "hello" test@sheng.com 内容就是hello content

如果你的内容长 就保存到一个文件里 比如是mail
然后 cat mail | sendmail -s "hello" test@sheng.com

19,612

社区成员

发帖
与我相关
我的任务
社区描述
系统使用、管理、维护问题。可以是Ubuntu, Fedora, Unix等等
社区管理员
  • 系统维护与使用区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧