mule-smtp.xml:
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:spring="http://www.springframework.org/schema/beans" xmlns:smtp="http://www.mulesoft.org/schema/mule/smtp"
xmlns:file="http://www.mulesoft.org/schema/mule/file" xmlns:email="http://www.mulesoft.org/schema/mule/email"
xmlns:stdio="http://www.mulesoft.org/schema/mule/stdio"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.1/mule.xsd
http://www.mulesoft.org/schema/mule/smtp http://www.mulesoft.org/schema/mule/smtp/3.1/mule-smtp.xsd
http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/3.1/mule-file.xsd
http://www.mulesoft.org/schema/mule/email http://www.mulesoft.org/schema/mule/email/3.1/mule-email.xsd
http://www.mulesoft.org/schema/mule/stdio http://www.mulesoft.org/schema/mule/stdio/3.1/mule-stdio.xsd">
<stdio:connector name="SystemStreamConnector"
promptMessage="please enter something:" />
<smtp:connector name="smtpConnector" />
<flow name="processed-orders">
<file:inbound-endpoint path="E:/out">
<file:file-to-string-transformer />
</file:inbound-endpoint>
<!--<stdio:inbound-endpoint system="IN" />
--><!-- 配置从控制台输入你的东西 -->
<smtp:outbound-endpoint host="219.142.78.189"
user="linlin_jiong" password="xiaoli" port="25" from="linlin_jiong@sina.com"
subject="processed order" to="linlin_jiong@163.com">
<email:string-to-email-transformer />
</smtp:outbound-endpoint>
</flow>
</mule>
运行:
结果:
从服务器路径"E:/out/"中读取文件内容,将文件内容由邮箱from发送到邮箱to,但是邮件中文内容是乱码,我暂时还没找到解决办法,有知道的兄弟麻烦告知下!
