Created
August 16, 2011 19:04
-
-
Save porcelli/1149868 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void main(String... args) throws MuleException { | |
Mule mule = Mule.newInstance(new AbstractModule() { | |
@Override | |
protected void configure() { | |
flow("SendEmail") | |
.send("smtp://smtp.mycompany.com:25?address=#[header:address]"); | |
} | |
}); | |
mule.start(); // start mule | |
final Map<String, Object> properties = new HashMap<String, Object>(); //map that holds payload message properties | |
properties.put("subject", "Look this cool feature!"); //email subject | |
properties.put("address", "[email protected]"); //email address to send to | |
final String mailContent = "Send emails direct from Mule DSL!"; //email content | |
mule.flow("SendEmail").process(mailContent, properties); //executes flow passing as arguments the mailContent alongside message properties | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment