Skip to content

Instantly share code, notes, and snippets.

@porcelli
Created August 16, 2011 19:04
Show Gist options
  • Save porcelli/1149868 to your computer and use it in GitHub Desktop.
Save porcelli/1149868 to your computer and use it in GitHub Desktop.
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", "mule_users@mycompany.com"); //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