1. 修改perf的版本不然会报错:
******************************************************************* Using the default of SSL_verify_mode of SSL_VERIFY_NONE for client is deprecated! Please set SSL_verify_mode to SSL_VERIFY_PEER together with SSL_ca_file|SSL_ca_path for verification. If you really don't want to verify the certificate and keep the connection open to Man-In-The-Middle attacks please set SSL_verify_mode explicitly to SSL_VERIFY_NONE in your application. ******************************************************************* at /usr/bin/sendEmail line 1906. invalid SSL_version specified at /usr/share/perl5/vendor_perl/IO/Socket/SSL.pm line 415.
安装的方法:
wget http://www.cpan.org/src/5.0/perl-5.10.0.tar.gz tar -zxf perl-5.10.0.tar.gz cd perl-5.10.0 ./configure.gnu -des -Dprefix=/usr/local/perl make && make install mv /usr/bin/perl /usr/bin/perl.bak ln -s /usr/local/perl/bin/perl /usr/bin/perl perl -v
2. 安装 sendMail
wget http://caspian.dotconf.net/menu/Software/SendEmail/sendEmail-v1.56.tar.gz tar -xzvf sendEmail-v1.56.tar.gz / mv sendEmail /usr/local/bin/
3. 使用命令发邮件:
sendEmail -f jinanxiaolaohu@163.com -s smtp.163.com -u "Linux sendMail" -o message-content-type=html -o message-charset=utf-8 -xu jinanxiaolaohu@163.com -xp 'YourPasswords' -t zhaobsh@inspur.com -m 邮件
4. 参数说明:
/usr/local/bin/sendEmail 命令主程序 -f yxylinux@163.com 发件人邮箱 -s smtp.163.com 发件人邮箱的smtp服务器 -u "我是邮件主题" 邮件的标题 -o message-content-type=html 邮件内容的格式,html表示它是html格式 -o message-charset=utf8 邮件内容编码 -xu yxylinux@163.com 发件人邮箱的用户名 -xp 123456 发件人邮箱密码 -m "我是邮件内容" 邮件的具体内容
参考
https://blog.51cto.com/hequan/1811246
https://www.cnblogs.com/yxy-linux/p/5780302.html