0

有人可以帮忙吗,

当我使用该命令时,我收到了没有主题的电子邮件,

mail -s "subject" emailid < content.txt

这个命令有什么问题吗?

4

2 回答 2

2

尝试这个

[root@host ~ ]# mail -s "test" me@gmail.com
This will be in the body of the email
Cc: me_cc@gmail.com
.
[root@host ~ ]# 

单独的.行告诉邮件命令您已完成编写电子邮件正文并充当EOF命令的一个。

另一种方式

[root@host ~ ]# echo "This will be the body of the email" | mail -s "This is the subject"   me@gmail.com

希望它有效。在我的机器上工作。请确保已安装 sendmail 应用程序并正常工作。

EDIT

对于 Sun OS 试试这个

echo "Hello World" | mailx -s "Hello World Test" emailaddress.com
于 2012-06-26T06:17:17.940 回答
1

使用mailx而不是mail我猜你正在使用太阳操作系统。

于 2012-07-17T14:07:35.013 回答