LibraryToggle FramesPrintFeedback

Name

Mail — provides access to e-mail systems

Options

Table 7.7 describes the options for Mail endpoints.

Table 7.7. Mail endpoint options

PropertyDefaultDescription
host   The host name or IP address to connect to.
port See Table 7.6 The TCP port number to connect on.
username  The user name on the email server.
password  The password on the email server.
ignoreUriScheme false If false, Apache Camel uses the scheme to determine the transport protocol (POP, IMAP, SMTP etc.)
defaultEncoding   The default encoding to use for Mime Messages.
contentType text/plain The mail message content type. Use text/html for HTML mails.
folderName INBOX The folder to poll.
to username@host The recipients. Separate multiple email addresses with a comma.
CC  The CC recipients. Separate multiple email addresses with a comma.
BCC The BCC recipients. Separate multiple email addresses with a comma.
from camel@localhost The FROM email address.
subject  The Subject of the message being sent. Note: Setting the subject in the header takes precedence over this option.
delete false Deletes the messages after they have been processed. This is done by setting the DELETED flag on the mail message. If false, the SEEN flag is set instead.
unseen true Is used to only fetch unseen(new) messages. POP3 does not support the SEEN flag.
fetchSize -1 Specifies the maximum number of messages to consume during a poll.The default value of -1 means all available messages will be consumed. Setting the value to 0 means Apache Camel will not consume any messages.
alternativeBodyHeader CamelMailAlternativeBody Specifies the key to an IN message header that contains an alternative email body. For example, if you send emails in text/html format and want to provide an alternative mail body for non-HTML email clients, set the alternative mail body with this key as a header.
debugMode false Specifies if debug mode is enabled on the underlying mail framework. The SUN Mail framework logs the debug messages to System.out by default.
connectionTimeout 30000 The connection timeout can be configured in milliseconds.
consumer.initialDelay 1000 Milliseconds before the polling starts.
consumer.delay 60000 Specifies the consumer delay in milliseconds.
consumer.useFixedDelay false Set to true to use a fixed delay between polls, otherwise fixed rate is used. See ScheduledExecutorService in JDK for details.
mail.XXX  You can set any additional java mail properties.
maxMessagesPerPoll 0 Specifies the maximum number of messages to gather per poll. The default value of 0 (or a negative value) disables this option.
javaMailSender  Specifies a custom implementation of the Spring JavaMailSender interface in order to use a custom email implementation. If none provided, Apache Camel uses the default Spring JavaMailSenderImpl implementation.
ignoreUnsupportedCharset false Option to let Apache Camel ignore unsupported charsets in the local JVM when sending mails. If the charset is unsupported then charset=XXX is removed from the content-type and it relies on the platform default instead.

SUN JavaMail

SUN JavaMail is used under the hood for consuming and producing mails. We encourage end-users to consult these references when using either POP3 or IMAP protocol. Note particularly that POP3 has a much more limited set of features than IMAP.

Comments powered by Disqus