camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache Camel > gmail
Date Mon, 16 Nov 2009 09:08:00 GMT
<html>
<head>
    <base href="http://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/1519/1/1/_/styles/combined.css?spaceKey=CAMEL&amp;forWysiwyg=true"
type="text/css">
    </head>
<body style="background-color: white" bgcolor="white">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="http://cwiki.apache.org/confluence/display/CAMEL/gmail">gmail</a></h2>
    <h4>Page  <b>added</b> by             <a href="http://cwiki.apache.org/confluence/display/~mrt1nz">Martin
Krasser</a>
    </h4>
         <br/>
    <div class="notificationGreySide">
         <h2><a name="gmail-%7B%7Bgmail%7D%7DComponent"></a><tt>gmail</tt>
Component</h2>

<p>The <tt>gmail</tt> component contributes to the <a href="/confluence/display/CAMEL/GAE"
title="GAE">Camel Components for Google App Engine</a> (GAE). Supports sending of
emails via the GAE <a href="http://code.google.com/appengine/docs/java/mail/" rel="nofollow">mail
service</a>. Receiving mails is not supported yet but will be added later. Currently,
only Google accounts that are application administrators can send emails.</p>

<h3><a name="gmail-URIformat"></a>URI format</h3>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
gmail:<span class="code-comment">//user@gmail.com[?options]
</span>gmail:<span class="code-comment">//user@googlemail.com[?options]</span>
</pre>
</div></div>

<h3><a name="gmail-Options"></a>Options</h3>

<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Name </th>
<th class='confluenceTh'> Default Value </th>
<th class='confluenceTh'> Context </th>
<th class='confluenceTh'> Description </th>
</tr>
<tr>
<td class='confluenceTd'> <tt>to</tt> </td>
<td class='confluenceTd'> <tt>null</tt> </td>
<td class='confluenceTd'> Producer </td>
<td class='confluenceTd'> Receiver of the email.</td>
</tr>
<tr>
<td class='confluenceTd'> <tt>subject</tt> </td>
<td class='confluenceTd'> <tt>null</tt> </td>
<td class='confluenceTd'> Producer </td>
<td class='confluenceTd'> Subject of the email.</td>
</tr>
<tr>
<td class='confluenceTd'> <tt>outboundBindingRef</tt> </td>
<td class='confluenceTd'> reference to <tt>GMailBinding</tt> </td>
<td class='confluenceTd'> Producer </td>
<td class='confluenceTd'>Reference to an <tt>OutboundBinding&lt;GMailEndpoint,
MailService.Message, void&gt;</tt> in the <a href="/confluence/display/CAMEL/Registry"
title="Registry">Registry</a> for customizing the binding of an <tt>Exchange</tt>
to the mail service.</td>
</tr>
<tr>
<td class='confluenceTd'> <tt>mailServiceRef</tt> </td>
<td class='confluenceTd'> reference to <tt>MailServiceFactory.getMailService()</tt>
</td>
<td class='confluenceTd'> Producer </td>
<td class='confluenceTd'>Reference to a <tt>MailService</tt> in the <a
href="/confluence/display/CAMEL/Registry" title="Registry">Registry</a>. Only relevant
in context of testing. </td>
</tr>
</tbody></table>

<h3><a name="gmail-Messageheaders"></a>Message headers</h3>

<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Name </th>
<th class='confluenceTh'> Type </th>
<th class='confluenceTh'> Context </th>
<th class='confluenceTh'> Description </th>
</tr>
<tr>
<td class='confluenceTd'> <tt>GMailBinding.GMAIL_SUBJECT</tt> </td>
<td class='confluenceTd'> <tt>String</tt> </td>
<td class='confluenceTd'> Producer </td>
<td class='confluenceTd'> Subject of the email. Overrides <tt>subject</tt>
endpoint option.</td>
</tr>
<tr>
<td class='confluenceTd'> <tt>GMailBinding.GMAIL_TO</tt> </td>
<td class='confluenceTd'> <tt>String</tt> </td>
<td class='confluenceTd'> Consumer </td>
<td class='confluenceTd'> Receiver of the email. Overrides <tt>to</tt> endpoint
option.</td>
</tr>
</tbody></table>

<h3><a name="gmail-Messagebody"></a>Message body</h3>

<p>On the producer side the <tt>in</tt> message body is converted to a <tt>String</tt>.</p>

<h3><a name="gmail-Usage"></a>Usage</h3>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
...
.setHeader(GMailBinding.GMAIL_SUBJECT, constant(<span class="code-quote">"Hello"</span>))
.setHeader(GMailBinding.GMAIL_TO, constant(<span class="code-quote">"account2@somewhere.com"</span>))
.to(<span class="code-quote">"gmail:<span class="code-comment">//account1@gmail.com"</span>);</span>
</pre>
</div></div>

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

<h4><a name="gmail-Advancedusage"></a>Advanced usage</h4>

<p>TODO ...</p>

<h3><a name="gmail-Dependencies"></a>Dependencies</h3>

<p>Maven users will need to add the following dependency to their <tt>pom.xml</tt>.
</p>

<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader"
style="border-bottom-width: 1px;"><b>pom.xml</b></div><div class="codeContent
panelContent">
<pre class="code-xml">
<span class="code-tag">&lt;dependency&gt;</span>
    <span class="code-tag">&lt;groupId&gt;</span>org.apache.camel<span
class="code-tag">&lt;/groupId&gt;</span>
    <span class="code-tag">&lt;artifactId&gt;</span>camel-gae<span
class="code-tag">&lt;/artifactId&gt;</span>
    <span class="code-tag">&lt;version&gt;</span>${camel-version}<span
class="code-tag">&lt;/version&gt;</span>
<span class="code-tag">&lt;/dependency&gt;</span>
</pre>
</div></div>

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

<h3><a name="gmail-SeeAlso"></a>See Also</h3>
<ul>
	<li><a href="/confluence/display/CAMEL/Configuring+Camel" title="Configuring Camel">Configuring
Camel</a></li>
	<li><a href="/confluence/display/CAMEL/Component" title="Component">Component</a></li>
	<li><a href="/confluence/display/CAMEL/Endpoint" title="Endpoint">Endpoint</a></li>
	<li><a href="/confluence/display/CAMEL/Getting+Started" title="Getting Started">Getting
Started</a></li>
</ul>

    </div>
    <div id="commentsSection" class="wiki-content pageSection">
       <div style="float: right;">
            <a href="http://cwiki.apache.org/confluence/users/viewnotifications.action"
class="grey">Change Notification Preferences</a>
       </div>
       <a href="http://cwiki.apache.org/confluence/display/CAMEL/gmail">View Online</a>
              |
       <a href="http://cwiki.apache.org/confluence/display/CAMEL/gmail?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
           </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message