You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

gmail Component

The gmail component contributes to the Camel Components for Google App Engine (GAE). It supports sending of emails via the GAE mail service. Receiving mails is not supported yet but will be added later. Currently, only Google accounts that are application administrators can send emails.

URI format

gmail://user@gmail.com[?options]
gmail://user@googlemail.com[?options]

Options

Name

Default Value

Context

Description

to

null

Producer

Receiver of the email.

subject

null

Producer

Subject of the email.

outboundBindingRef

reference to GMailBinding

Producer

Reference to an OutboundBinding<GMailEndpoint, MailService.Message, void> in the Registry for customizing the binding of an Exchange to the mail service.

mailServiceRef

reference to MailServiceFactory.getMailService()

Producer

Reference to a MailService in the Registry. Only relevant in context of testing.

Message headers

Name

Type

Context

Description

GMailBinding.GMAIL_SUBJECT

String

Producer

Subject of the email. Overrides subject endpoint option.

GMailBinding.GMAIL_TO

String

Consumer

Receiver of the email. Overrides to endpoint option.

Message body

On the producer side the in message body is converted to a String.

Usage

...
.setHeader(GMailBinding.GMAIL_SUBJECT, constant("Hello"))
.setHeader(GMailBinding.GMAIL_TO, constant("account2@somewhere.com"))
.to("gmail://account1@gmail.com");

Sends an email with subject Hello from account1@gmail.com to account2@somewhere.com. The mail message body is taken from the in message body. Please note that account1@gmail.com must be an administrator account for the current GAE application.

Dependencies

Maven users will need to add the following dependency to their pom.xml.

pom.xml
<dependency>
    <groupId>org.apache.camel</groupId>
    <artifactId>camel-gae</artifactId>
    <version>${camel-version}</version>
</dependency>

where ${camel-version} must be replaced by the actual version of Camel (2.1-M1 or higher).

  • No labels