PHP
  Home arrow PHP arrow Coding Folders for a PHP Email Applica...
Dev Shed Forums 
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Sun Developer Network 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Moblin 
JMSL Numerical Library 
VPS Hosting 
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? 
PHP

Coding Folders for a PHP Email Application
By: Leidago
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 6
    2006-11-15

    Table of Contents:
  • Coding Folders for a PHP Email Application
  • Form Data
  • Explaining Sections B and C
  • The Sent, Trash and Drafts Folders

  • 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


    Coding Folders for a PHP Email Application


    (Page 1 of 4 )

    In this article, the fourth and final one of our series covering the creation of a PHP email application, we are going to look at the code for some of the remaining pages of the mail application. Chief among these is the NewMsg.php page, which is where items, to be more precise, new messages, are either saved as drafts or saved as sent messages.

    Let's see how this one script affects the other ones. Here's an illustrative diagram:

    NewMsg.php - > Sent message

             |____________________

             |                                       |

    Drafts Folder                       Sent Message FolderOptional

    Let's start with the NewMsg page. First you are presented with a form that will take the following input: To, Cc, BCc, Subject, Attachment and message text. All of these are required to send a valid email message.

    <table width="100%" border="0" class="block">

            <tr>

              <td width="10%" valign="top"><strong>To</strong></td>

              <td width="90%"><input name="to" type="text" id="to"
    size="70"  value="<? if(isset($r['to'])){

                              $r['to'];} ?>"/></td>

            </tr>

            <tr>

              <td valign="top"><strong>Cc</strong></td>

              <td><input name="cc" type="text" id="cc" size="70"
    value="<? if(isset($r['cc'])){

                              $r['cc'];} ?>"/></td>

            </tr>

            <tr>

              <td valign="top"><strong>Bcc</strong></td>

              <td><input name="bcc" type="text" id="bcc" size="70"
    value="<? if(isset($r['bcc'])){

                              $r['bcc'];} ?>"/></td>

            </tr>

            <tr>

              <td valign="top"><strong>Subject</strong></td>

              <td><input name="sub" type="text" id="sub" size="80"  value="<? if(isset($r['subject'])){

                              $r['subject'];} ?>"/></td>

            </tr>

            <tr>

              <td valign="top"><strong>Attachment</strong></td>

              <td>

                              <input name="userfile" type="file"
    id="userfile" size="80" value="<? if(isset($r['attachment'])){

                              $r['attachment'];} ?>"/></td>

            </tr>

            <tr>

              <td valign="top"><strong>Message:</strong></td>

              <td><? $checked = false;

                              if($checked){ ?>

                              <textarea name="msg" cols="90" rows="9"
    id="msg"><? if(isset($r['msg_body'])){

                              $r['msg_body'];} } ?></textarea>

                              <? if($checked){

    // Automatically calculates the editor base path based on the
    _samples directory.

    // This is useful only for these samples. A real application
    should use something like this:

    // $oFCKeditor->BasePath = '/FCKeditor/' ;   // '/FCKeditor/' is
    the default value.

    $sBasePath ='fckeditor/fckeditor.php';

    $oFCKeditor = new FCKeditor('FCKeditor1') ;

    $oFCKeditor->BasePath         = $sBasePath ;

    $oFCKeditor->Value               = 'This is some <strong>sample
    text</strong>. You are using <a
    href="http://www.fckeditor.net/">FCKeditor</a>.' ;

    $oFCKeditor->Create() ;

    }

    ?>

                              </td>

            </tr>

            <tr>

              <td>&nbsp;</td><*/span>

              <td><input type="submit" name="Submit" value="Send
    Message" />

                <input name="draft" type="submit" id="draft"
    value="Save As Draft" />

                <input name="save" type="checkbox" id="save"
    value="checkbox" />

                Save Sent Message</td>

            </tr>

          </table>

    The text in red shows a selection of choices. The first choice is to just send the message as is. The second gives you the option of  saving the message as a draft, and the third choice gives you the option of saving the message in the "Sent Messages" Folder. Some of these choices can be made simultaneously and others cannot. For example, if you click on "save as draft" then the message will be saved in the drafts folder instead of being sent. On the other hand, if you want to send the message and save it in the sent folder, that is allowed.

    More PHP Articles
    More By Leidago


       · Hi Leidago, as I have commented before on the articles about the invoicing system, ...
       · Thank you for your critique, but i'm afraid We are just going into circles on the...
     

       

    PHP ARTICLES

    - Validating Web Forms with the Code Igniter P...
    - Output Buffering
    - Paginating Database Records with the Code Ig...
    - HTTP Headers in Web Development
    - Project Management: Administration
    - Building a Database-Driven Application with ...
    - User Authentication for a Project Management...
    - Introduction to the CodeIgniter PHP Framework
    - Adding Users for a Project Management Applic...
    - Migrating Class Code for a MIME Email to PHP...
    - Login and Logout Authentication for a Projec...
    - Composing Messages in HTML for MIME Email wi...
    - Project Management: Authentication
    - A Better Way to Determine MIME Types for MIM...
    - Project Management Overview





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