<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>Jaggery - Delicious Javascript</title>
    <meta name="description" content="">
    <meta name="author" content="">

    <!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
    <!--[if lt IE 9]>
    <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->

    <!-- Le styles -->
    <link href="../css/bootstrap.css" rel="stylesheet">
    <style type="text/css">
        body {
            padding-top: 60px;
        }
    </style>
    <link href="../css/prettify.css" rel="stylesheet">
    <!-- Le fav and touch icons -->
    <link rel="shortcut icon" href="../images/favicon.ico">
    <link rel="apple-touch-icon" href="../images/apple-touch-icon.png">
    <link rel="apple-touch-icon" sizes="72x72"
          href="../images/apple-touch-icon-72x72.png">
    <link rel="apple-touch-icon" sizes="114x114"
          href="../images/apple-touch-icon-114x114.png">
</head>

<body>

<%
include('/includes/topnavi.jag');
%>

<div class="container-fluid" style="width: 960px; margin: auto;">
<div class="row">
    <div class="span16">
        <div class="page-header">
            <h1  id="top">
                Documentation
                <small>API documentation for Jaggery.js</small>
            </h1>
        </div>
    </div>
</div>

<div class="row">
<div class="span4">
    <div class="well">
        <%
        include('/includes/navi.jag');
        %>

    </div>

</div>
<div class="span12">
<div class="content" id="email" name="email">
<h3>Email</h3>

<pre class="prettyprint linenums">
&lt%

    var cont = request.getParameter("cont");
    var to = request.getParameter("to");
    var sub = request.getParameter("sub");

    //Add valid credentials
    var email = new Email("smtp.gmail.com", "25", "username", "password");

    //Fill the correct information
    email.from = "";
    email.to = to;
    email.cc = "";
    email.bcc = "";
    email.subject = sub;
    email.text = cont;
    email.send();

    print("email successfully sent to " + to);
%&gt
</pre>
<%

var emailCode = '&lt% \n var cont = request.getParameter("cont");'
+ '\n var to = request.getParameter("to");'
+ '\n var sub = request.getParameter("sub");'
+ '\n '
+ '\n //Add valid credentials'
+ '\n var email = new Email("smtp.gmail.com", "25", "username", "password");'
+ '\n '
+ '\n //Fill the correct information'
+ '\n email.from = "";'
+ '\n email.to = to;'
+ '\n email.cc = "";'
+ '\n email.bcc = "";'
+ '\n email.subject = sub;'
+ '\n email.text = cont;'
+ '\n email.send();'
+ '\n '
+ '\n print("email successfully sent to " + to); \n %&gt';

var codeSnip = encodeURIComponent(emailCode);
var urlString = '../tryitframe.jag?code='+codeSnip;

include('/includes/tryit_but.jag');
%>

 <div id="pageLinks">
<a class="navilink" href="#overview">Overview</a>
<a class="navilink" href="#members">Members</a>
<a class="navilink" href="#operations">Operations</a>
</div>


<section id="overview">  

<h4>Overview</h4>
<p class="description">The Email Object allows users to send out email from their mashups. It helps notify users of certain events and
    acts as a bridge between mashups and users.</p>

</section>	
	
<section id="members">	
<h4>Members</h4>

<p>Member Table goes here</p>

<table class="clsStd member-table">

    <tbody>

    <tr>
		<th>Member</th>
		<th>Type</th>
		<th>Default Value</th>
	</tr>
	<tr>
		<td>hELLO</td><td>member-table</td><td>member-table</td>
	</tr><tr>
		<td>hELLO</td><td>member-table</td><td>member-table</td>
	</tr><tr>
		<td>hELLO</td><td>member-table</td><td>member-table</td>
	</tr>
	</tbody>
</table><!-- /members table -->

</section>

<section id="operations">
<h4>Operations</h4>
<table class="clsStd operations-table">

    <tbody>

    <tr>

        <th>Member</th>
        <th>Returns</th>
        <th>Description</th>

    </tr>

    <tr>

        <td><code>constructor Email()</code>*</td>
        <td>Sometype</td>
        <td>Has two constructors for different arguments <br> <br>
            <pre class="prettyprint">
var email = new Email("smtp.gmail.com",
"username@gmail.com", "password");</pre>
            <br/>
            <pre class="prettyprint">
var email = new Email("smtp.gmail.com", "25",
"username@gmail.com", "password");
                    </pre>

        </td>

    </tr>

    <tr>

        <td><code>void from(string from)</code>*</td>
        <td>Sometype</td>
        <td>An optional property to set the "from" address of the
            email to be sent. If not set the user account used to
            authenticate against the email gateway will be sent as the
            "from" address. <br> <br>
            <pre class="prettyprint">email.from = "madhuka@wso2.com"; </pre>
        </td>

    </tr>

    <tr>

        <td><code>void to(String to) </code>
        </td>
        <td>sometype</td>
        <td>This is a required property that denotes the "to"
            address of the email to be sent. (Optionally an array of
            strings denoting the "to" addresses can be passed as below.) <br><br>
            <pre class="prettyprint">email.to = "nuwan@wso2.com"; </pre>
        </td>

    </tr>

    <tr>

        <td><code>void to(Array to) </code>
        </td>
         <td>Sometype</td>
        <td>This is a required property that denotes the "to"
            addresses of the email to be sent. (Optionally a string
            denoting a single "to" address can be passed as above.) <br>
            <br>
<pre class="prettyprint">
var to = new Array();
to[0] = "nuwan@wso2.com";
to[1] = "teague@wso2.com";
email.to = to; </pre>
        </td>

    </tr>


    </tbody>
</table>
</section>
</div>
<!-- /email div -->
<br>
<br>
</div>

</div>
<%
include('/includes/footer.jag');
%>


</div>
<!-- /container -->
<%
include('/includes/scripts.jag')
%>


	<script>	
		
		$(document).ready(function(){
        $('#head').toggleClass('active')
		$('#docs').addClass('active')
        });
		
	
		    
		
	</script>
</body>
</html>