Ubuntu使用Shell发送邮件

来源:互联网 发布:windows10数据库 编辑:程序博客网 时间:2024/06/04 19:21
#!/bin/bashemail_reciver=qqqqqq@qq.com#发送者邮箱email_sender=xxxxxx@163.com#邮箱用户名email_username=xxxxxx#邮箱密码#使用qq邮箱进行发送需要注意:首先需要开启:POP3/SMTP服务#其次发送邮件的密码需要使用在开启POP3/SMTP服务时候腾讯提供的第三方客户端登陆码。email_password=yyyyyy#file1_path="附件一路径"#file2_path="附件二路径"#smtp服务器地址email_smtphost=smtp.163.comemail_title="IP信息"email_content=`curl http://members.3322.org/dyndns/getip`sendemail -f ${email_sender} -t ${email_reciver} -s ${email_smtphost} \-u ${email_title} -xu ${email_username} -xp ${email_password} \-m ${email_content} -o message-charset=utf-8


注意,使用该脚本前必须先安装sendEmail软件:

sudo apt-get install sendemail
或下载安装包执行dpkg:

http://caspian.dotconf.net/menu/Software/SendEmail/#download

原创粉丝点击