informatica利用ant发送邮件
2013-07-16 11:04
190 查看
1)用command调用ant
#!/usr/bin/ksh
/test/infa/apache-ant-1.8.3/bin/ant -buildfile /test/infa/ant_mail/run_jiekou_status/build.xml
2)编写bulid.xml
<?xml version="1.0" encoding="utf-8" ?>
<project name="ant_mail" default="ant_mail" basedir=".">
<property file="email.properties" />
<target name="ant_mail" description="ant main task for send warning mail about error run">
<mail subject="${mail_name}" from="${mail.from.address}" tolist="${mail.to.addresses}" mailhost="${mail.smtp.host}" mailport="${mail.smtp.port}" user="${mail.account.user}" password="${mail.account.password}" ssl="${mail.smtp.ssl}">
<message charset="gb2312">--这里编码设置非常重要
${mail_content}
</message>
<attachments>
<fileset dir="${workflow.log.dir}">
<include name="${workflow.log.dir.file1}"/>
</fileset>
</attachments>
</mail>
</target>
</project>
3)编写属性文件
属性文件包含中文必须转码成gb2312
转码命令--native2ascii -encoding GBK resources.properties res.properties
#Write by Ferrari Huang ()
# Properties of Ant Tasks
mail.smtp.host=
mail.smtp.port=25
mail.smtp.ssl=false
mail.account.user=
mail.account.password=
mail.from.address=
mail.to.addresses=
workflow.log.dir=
workflow.log.dir.file1=ref_ctrl_jiekou_file1.out
mail_name=\u751f\u53d1\u73af\u5883-\u4e2d\u95f4\u5e93\u63a5\u53e3\u8868\u6570\u636e\u4f20\u8f93\u5931\u8d25
mail_content=\u4e2d\u95f4\u5e93\u63a5\u53e3\u8868\u6570\u636e\u4f20\u8f93\u5931\u8d25\uff0c\u5177\u4f53\u7cfb\u7edf\u540d\u79f0\u8868\u540d\u8bf7\u53c2\u8003\u9644\u4ef6\uff01
#!/usr/bin/ksh
/test/infa/apache-ant-1.8.3/bin/ant -buildfile /test/infa/ant_mail/run_jiekou_status/build.xml
2)编写bulid.xml
<?xml version="1.0" encoding="utf-8" ?>
<project name="ant_mail" default="ant_mail" basedir=".">
<property file="email.properties" />
<target name="ant_mail" description="ant main task for send warning mail about error run">
<mail subject="${mail_name}" from="${mail.from.address}" tolist="${mail.to.addresses}" mailhost="${mail.smtp.host}" mailport="${mail.smtp.port}" user="${mail.account.user}" password="${mail.account.password}" ssl="${mail.smtp.ssl}">
<message charset="gb2312">--这里编码设置非常重要
${mail_content}
</message>
<attachments>
<fileset dir="${workflow.log.dir}">
<include name="${workflow.log.dir.file1}"/>
</fileset>
</attachments>
</mail>
</target>
</project>
3)编写属性文件
属性文件包含中文必须转码成gb2312
转码命令--native2ascii -encoding GBK resources.properties res.properties
#Write by Ferrari Huang ()
# Properties of Ant Tasks
mail.smtp.host=
mail.smtp.port=25
mail.smtp.ssl=false
mail.account.user=
mail.account.password=
mail.from.address=
mail.to.addresses=
workflow.log.dir=
workflow.log.dir.file1=ref_ctrl_jiekou_file1.out
mail_name=\u751f\u53d1\u73af\u5883-\u4e2d\u95f4\u5e93\u63a5\u53e3\u8868\u6570\u636e\u4f20\u8f93\u5931\u8d25
mail_content=\u4e2d\u95f4\u5e93\u63a5\u53e3\u8868\u6570\u636e\u4f20\u8f93\u5931\u8d25\uff0c\u5177\u4f53\u7cfb\u7edf\u540d\u79f0\u8868\u540d\u8bf7\u53c2\u8003\u9644\u4ef6\uff01
相关文章推荐
- java 利用spring JavaMailSenderImpl发送邮件,支持普通文本、附件、html
- 安卓手机利用org.apache.commons.mail.HtmlEmail发送邮件
- python定时利用QQ邮件发送天气预报
- 利用JavaMail发送邮件示例
- 利用Python yagmail三行代码实现发送邮件
- 利用System.Net.Mail 发送邮件
- 利用PHPMailer发送邮件
- 利用SQL Server 2005数据库邮件发送电子邮件
- 利用oracle存储过程发送邮件附档
- 利用Node.JS实现邮件发送功能
- dos下利用SMTP、POP3协议发送邮件的过程
- Python Code: 利用QQ邮箱发送邮件,解决SMTPAuthenticationError:530错误
- 利用telnet smtp 邮件发送服务发送qq邮件
- 利用Zabbix通过邮件发送Screen图形报表实现
- 利用python 自写nagios发送邮件小程序
- SSIS 利用发送邮件服务 Send Email Task
- ANT发送邮件需要的3个JAR包
- 利用System.Net.Mail 的SmtpClient发送邮件
- 利用System.Web.Mail 发送邮件
- 利用JAVAMail发取和发送gmail邮件