Centos7使用sendEmail-v1.56发送邮件
注意:Centos7默认使用perl5.16,而sendEmail-v.1.56要求使用perl5.10。否则会报以下错误。所以需要下载并安装Perl-5.10
Using the default of SSL_verify_mode of SSL_VERIFY_NONE for client
is deprecated! Please set SSL_verify_mode to SSL_VERIFY_PEER
possibly 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/local/bin/sendEmail line 190****6.
invalid SSL_version specified at /usr/share/perl5/vendor_perl/IO/Socket/SSL.pm line 444
1.安装Perl-5.10
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
echo $? #返回0,编译没问题
make
make test
make install
备份原来的Perl
mv /usr/bin/perl /usr/bin/perl.bak
ln -s /usr/local/perl/bin/perl /usr/bin/perl
查看Perl版本,显示5.10表示已经成功
perl -v
2.安装sendEmail
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 [email protected] -s smtp.163.com -u "Linux sendMail" -o message-content-type=html -o message-charset=utf-8 -xu [email protected] -xp 'xfgzincrvghqbbdf' -t [email protected] -m "Hello World"
结果显示:Email was sent successfully!
注意:-m选项无法发送多条文本时,可通过附件发送多文本内容或
通过-o 把文件的内容当作正文部分。
-o message-file=/users/robin/addmrpt_1_11584_11649.txt
标签:v1.56,sendEmail,perl,Centos7,SSL,usr,com,邮件 From: https://www.cnblogs.com/tang-learning/p/16774252.html参数说明:
-f [email protected] 发件人邮箱
-s smtp.163.com 发件人邮箱的smtp服务器
-u "我是邮件主题" 邮件的标题
-o message-content-type=html 邮件内容的格式,html表示它是html格式
-o message-charset=utf8 邮件内容编码
-xu [email protected] 发件人邮箱的用户名
-xp ‘授权码’ 发件人邮箱授权码
-m "我是邮件内容" 邮件的具体内容