Author: keith
Date: Mon Jan 21 01:16:50 2008
New Revision: 12572

Log:

Adding initial documentation for email host object



Added:
   trunk/mashup/java/xdocs/emailhostobject.html

Added: trunk/mashup/java/xdocs/emailhostobject.html
==============================================================================
--- (empty file)
+++ trunk/mashup/java/xdocs/emailhostobject.html        Mon Jan 21 01:16:50 2008
@@ -0,0 +1,160 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+
+  <meta http-equiv="content-type" content="">
+  <title>Email Host Object</title>
+
+
+  <link href="styles.css" rel="stylesheet" type="text/css" media="all">
+
+</head>
+
+
+<body>
+
+<div id="main-content">
+<h1>Email Host Object</h1>
+
+<h3>1.0 Introduction</h3>
+
+<p>The Email object allows users to send out email from there
+mashups.&nbsp; It helps you notify users of certain events and acts
+as a brigde between mashups and users.</p>
+
+<h3>1.1 Example</h3>
+
+<div class="code">
+var email = new Email("host", "port", "username", "password");<br>
+
+var file = new File("temp.txt");<br>
+
+email.from = "[EMAIL PROTECTED]";<br>
+
+email.to = "[EMAIL PROTECTED]"; // alternatively message.to can be a array
+of strings. Same goes for cc and bcc<br>
+
+email.cc = "[EMAIL PROTECTED]";<br>
+
+email.bcc = "[EMAIL PROTECTED]";<br>
+
+email.subject = "WSO2 Mashup server 1.0 Released";<br>
+
+email.addAttachement(file, "temp.txt"); // Optionally can add
+attachements, it has a variable number of arguments. each argument can
+be a File hostObject or a string representing a file.<br>
+
+email.text = "WSO2 Mashup server 1.0 was Released on 28th January 2008";<br>
+
+email.send();<br>
+
+</div>
+
+<h3>2.0 Scraper Object</h3>
+
+<p>The Email Object has three different constructors. The one to
+use depends on your configuration and your need. They are as follows,</p>
+
+<ol>
+
+  <li>
+    <p>The first constructor takes no parameters and uses
+configuration information specified in the server.xml. Using a
+configuration such as this is usefull if you want to use a default
+email account to send out mails from your mashups. It also reduces the
+hassle of having to key in the configuration details each time you need
+a new email object.</p>
+
+    <div class="code">var email = new Email();</div>
+
+    <br>
+
+&nbsp;The configuration in the server.xml should be in the
+following form (The default server.xml has some prepopulated dummy
+values. Please update them as required.)<br>
+
+    <div style="margin-left: 40px;"><br>
+
+    </div>
+
+    <div class="code">&nbsp;
+&nbsp; &lt;!--Used to
+configure your default email account that
+will be used to send emails from mashups<br>
+
+&nbsp;&nbsp;&nbsp; using the Email host Object--&gt;<br>
+
+&nbsp;&nbsp;&nbsp; &lt;EmailConfig&gt;<br>
+
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+&lt;host&gt;smtp.gmail.com&lt;/host&gt;<br>
+
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+&lt;port&gt;25&lt;/port&gt;<br>
+
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+&lt;username&gt;[EMAIL PROTECTED]&lt;/username&gt;<br>
+
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+&lt;password&gt;password&lt;/password&gt;<br>
+
+&nbsp;&nbsp;&nbsp; &lt;/EmailConfig&gt;</div>
+
+    <p>Note: Changed to the
+server.xml requires a server restart.</p>
+
+  </li>
+
+  <li>
+    <p>The second constructor unlike the first requires the user
+to provide the configuration details each time he creates a new email
+object. &nbsp;The plus point is that no server configuration is
+needed and you can use diffent accounts when ever you need. The
+configuration details should be given as follws,<br>
+
+    </p>
+
+    <div class="code">var email = new
+Email("smtp.gmail.com",
+"25", "[EMAIL PROTECTED]", "password"); // host, port, username,
+password</div>
+
+    <p>Note : If the configuration
+details are given in the server.xml and the user uses the above
+constrctor, the details given by the user when creating the email
+object gets precedence.</p>
+
+  </li>
+
+  <li>
+    <p>The third is a slight variant of the second. It does not
+require a port to be specified</p>
+
+    <div class="code">var email = new
+Email("smtp.gmail.com",
+"25", "[EMAIL PROTECTED]", "password"); // host, port, username,
+password</div>
+
+  </li>
+
+</ol>
+
+<br>
+
+<h3>3.0 References<br>
+
+</h3>
+
+<ul>
+
+  <li><a href="apidocs/org/wso2/mashup/hostobjects/email/Email.html">JavaDoc
+for the Email host Object</a></li>
+
+</ul>
+
+</div>
+
+<p>� WSO2 Inc.</p>
+
+</body>
+</html>

_______________________________________________
Mashup-dev mailing list
[email protected]
http://www.wso2.org/cgi-bin/mailman/listinfo/mashup-dev

Reply via email to