1、下载
http://caspian.dotconf.net/menu/Software/SendEmail/sendEmail-v1.56.tar.gz
2、安装
tar zxvf sendEmail-v1.56.tar.gz
cd sendEmail-v1.56
cp sendEmail /usr/local/bin/
chmod 775 /usr/local/bin/sendEmail
chown infa:oinstall /usr/local/bin/sendEmail# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin:/usr/local/bin
export PATH
(修改环境变量)
注:需要在邮件服务器中给当前主机授予发送、接受邮件的权限;
4、测试(默认用户)
sendEmail -f postmaster@crv.com.cn -t liuyxxxxx@crv.com.cn -s mail.crv.com.cn -u "test" -xu -xp -m "test" -o message-charset=UTF-8
5、参数说明
-f 表示发送者的邮箱
-t 表示接收者的邮箱
-s 表示SMTP服务器的域名或者ip
-u 表示邮件的主题
-xu 表示SMTP验证的用户名
-xp 表示SMTP验证的密码(注意,这个密码貌似有限制,例如我用d!5neyland就不能被正确识别)
-m 表示邮件的内容
-cc 表示抄送
-bcc 表示暗抄送
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/31379016/viewspace-2123572/ ,如需转载,请注明出处,否则将追究法律责任。