We start with a simple route that sends the messages received from a JMS queue as
emails. The email account is the
admin account on
In the next sample, we poll a mailbox for new emails once every minute. Notice that we
use the special
consumer option for setting the poll interval,
consumer.delay, as 60000 milliseconds = 60 seconds.
from("imap://firstname.lastname@example.org&password=secret &unseen=true&consumer.delay=60000") .to("seda://mails");
In this sample we want to send a mail to multiple recipients.
// all the recipients of this mail are: // To: email@example.com , firstname.lastname@example.org // CC: email@example.com // BCC: firstname.lastname@example.org String recipients = "&Toemail@example.com,firstname.lastname@example.org& CCemail@example.com&BCCfirstname.lastname@example.org"; from("direct:a") .to("smtp://email@example.com?password=secret&Fromfirstname.lastname@example.org" + recipients);
Check the Apache Camel website for several more examples, including handling mail attachments and SSL configuration.