JavaScript
  Home arrow JavaScript arrow Page 4 - Building an SMTP Client with Prototype
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Dedicated Servers  
Moblin 
JMSL Numerical Library 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
JAVASCRIPT

Building an SMTP Client with Prototype
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 2 stars2 stars2 stars2 stars2 stars / 4
    2007-09-26

    Table of Contents:
  • Building an SMTP Client with Prototype
  • Defining the front end of the Prototype-driven SMTP client application
  • Defining the SMTP client's structural markup
  • Listing the complete client-side code for the SMTP application

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Building an SMTP Client with Prototype - Listing the complete client-side code for the SMTP application


    (Page 4 of 4 )

    Quite possibly, one of the most interesting parts of an article that shows how to develop a certain web application is the one that shows its full source code. Below I listed the complete client-side code that corresponds to this Prototype-driven SMTP client, so you can copy it and paste it into your favorite text editor. Eventually you may want to introduce your own improvements.

    The entire code listing looks like this:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml">

    <head>

    <meta http-equiv="Content-Type" content="text/html; charset=iso-
    8859-1" />

    <title>Prototype-based SMTP Client</title>

    <style type="text/css">

      body{

        padding: 0;

        margin: 0;

        background: #fff;

     }

     h1{

         font: bold 24px Arial, Helvetica, sans-serif;

          color: #000;

         text-align: center;

     }

     p{

         font: bold 12px Arial, Helvetica, sans-serif;

          color: #000;

          padding-right: 100px;

         text-align: right;

     }

      textarea{

        width: 400px;

         height: 300px;

         padding: 2px;

         font: normal 12px Arial, Helvetica, sans-serif;

          color: #000;

     }

     #maincontainer{

        width: 600px;

         height: 550px;

         margin-left: auto;

         margin-right: auto;

        background: #f5ebb1;

        border: 1px solid #000; 

     }

     #state{

         font: bold 12px Arial, Helvetica, sans-serif;

          color: #00f;

         padding: 10px 0 10px 10px;

     }

     .textbox{

        width: 400px;

         padding: 2px;

         font: normal 12px Arial, Helvetica, sans-serif;

          color: #000;

     }

      .formbutton{

         font: normal 12px Arial, Helvetica, sans-serif;

          color: #000;

     }

    </style>

    </head>

    <body>

    <h1>Prototype-based SMTP Client</h1>

    <div id="maincontainer">

    <div id="state">STATUS: COMPOSING MESSAGE...</div>

    <form id="mailform">

    <p>To: <input type="text" id="to" title="enter email address of
    recipient" class="textbox" /></p>

    <p>Subject: <input type="text" id="subject" title="enter the
    subject of your message" class="textbox" /></p>

    <p>Cc: <input type="text" id="cc" class="textbox" /></p>

    <p>Bcc: <input type="text" id="bcc" class="textbox" /></p>

    <p><textarea name="message" title="Type here the text of your
    message" id="message"></textarea></p>

    <p><input type="submit" value="Send Message" class="formbutton" title="Send Message"/>

    <input type="reset" value="Clear All Fields" class="formbutton"
    title="Clear All Fields" />

    <input type="button" value="Clear Message" class="formbutton"
    title="Clear Message" id="resetbutton"/></p>

    </form>

    </div>

    </body>

    </html>

    That's all the client-side code required to display on your browser the user interface that you saw in the beginning of this article. Of course, there's plenty of room here to tweak the CSS styles and markup shown in this tutorial to suit your personal needs.

    Final thoughts

    In this first installment of the series, I showed you how to create the simple front end that belongs to this SMTP application. Nevertheless, you'll have noticed that the Prototype library hasn't been used, since no JavaScript code has been defined yet.

    Well, if you feel rather disappointed, I've got good news for you. In the next part of the series, I'm going to teach you how to take advantage of the numerous functions and classes that come bundled with Prototype to turn this SMTP client into a fully-functional piece of code. You won't want to miss it!


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

       · True to form, the AJAX capacities offered by the Prototype JavaScript library are...
       · just made me lose time, title of tutorial is prototype and afterall al its just...
     

    JAVASCRIPT ARTICLES

    - Book Review: Learning the Yahoo! User Interf...
    - Dynamically Generate a Selection List in a R...
    - Intergrate DWR into Your Java Web Application
    - Detect Browser Compatibility with the Reques...
    - Using the EXT JS Date Picker Widget
    - Ajax Hack for Entering Information Without R...
    - EXT JS 2.1 Overview
    - Using the Style Object for Zebra Tables with...
    - Binary Searching
    - An Improved Approach to Building Zebra Tables
    - Assigning Background Colors Dynamically to Z...
    - Building Zebra Tables with CSS and JavaScript
    - JavaScript: Array Objects
    - A Closer Look at Smart Markers with Yahoo! M...
    - Using Polylines and Smart Markers with Yahoo...







    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway