Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
65 lines (58 sloc) 3.19 KB
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:http="http://www.mulesoft.org/schema/mule/http"
xmlns:cxf="http://www.mulesoft.org/schema/mule/cxf" xmlns:context="http://www.springframework.org/schema/context"
xmlns:smtps="http://www.mulesoft.org/schema/mule/smtps" xmlns:smtp="http://www.mulesoft.org/schema/mule/smtp"
xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:spring="http://www.springframework.org/schema/beans" xmlns:core="http://www.mulesoft.org/schema/mule/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="CE-3.3.0"
xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/cxf http://www.mulesoft.org/schema/mule/cxf/current/mule-cxf.xsd
http://www.mulesoft.org/schema/mule/smtps http://www.mulesoft.org/schema/mule/smtps/current/mule-smtps.xsd
http://www.mulesoft.org/schema/mule/smtp http://www.mulesoft.org/schema/mule/smtp/current/mule-smtp.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-current.xsd ">
<!--
The Gmail connector is part of connectors that Mule ESB offers out of the box.
-->
<smtp:gmail-connector name="emailConnector"
doc:name="Gmail" />
<!--
The flows starts here
-->
<flow name="GMailService-configFlow1" doc:name="GMailService-configFlow1">
<!--
Configuring the HTTP inbound
-->
<http:inbound-endpoint exchange-pattern="request-response"
address="http://localhost:9094/gmailService" doc:name="HTTP" />
<!--
In this block the SOAP CXF Service is configured. We need two java classes one is for
set up the Simple Front end of the Web Service and the other one is for return the payload
to the flow, in this case the mail that we want to send.
-->
<cxf:jaxws-service serviceClass="com.marco.tello.gmail.service.IGmailService"
doc:name="IGmailService" enableMuleSoapHeaders="false"/>
<component class="com.marco.tello.gmail.service.GmailService" doc:name="GMailService" />
<object-to-string-transformer doc:name="Object to String" />
<!--
We generate a response for the SOAP Service.
-->
<response>
<set-payload value="Your Message has been sent."
doc:name="Set Payload" />
</response>
<logger message="******** #[payload]" level="INFO" doc:name="Logger" doc:description="Just for log the message to send"/>
<echo-component doc:name="Echo" />
<!--
Setting the outbound
Note that the user has to be set up with an "%40" instead of "@" otherwise the
SMTP outbound wont work, and you'll have to do the same for the password all
the @'s wont wont work.
-->
<smtps:outbound-endpoint host="smtp.gmail.com" user="your_address%40gmail.com"
password="THE_PASSWORD" from="your_gmail_user@gmail.com" subject="Email from Mule ESB"
doc:name="Send notification email" to="your_address@some_domain.com" />
</flow>
</mule>