在Ubuntu 13.04上,我一直试图从命令行发送邮件,但邮件命令不会返回。 我从一个腻子terminal里面运行这些:
sudo apt-get install mailutils sudo apt-get install sendemail echo "test message" | sendmail -s 'test subject' [email protected]
要么
sendmail -s "test" [email protected] < out
这两个都会导致游标不能返回到命令提示符。 我也尝试使用mail , ssmtp和postfix (也安装了所有)的其他变化。 他们都做同样的事情。 对于ssmtp我添加这样的configuration:
[email protected] mailhub=smtp.gmail.com:465 rewriteDomain=gmail.com AuthUser=aaaa AuthPass=pass FromLineOverride=YES
试试这个,它适用于12.04,我确定他们没有改变那个包
apt-get install bsd-mailx
然后你可以发送邮件
echo "hi there" | mail -s "subject here" [email protected]
尝试collowingtesting命令:
(echo "subject: test"; echo) | /usr/sbin/sendmail -i [email protected] (echo "subject: test"; echo) | /usr/sbin/sendmail -v -i [email protected]