PHP
  Home arrow PHP arrow Coding Folders for a PHP Email Application
Dev Shed Forums 
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Forums Sitemap 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
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? 
Google.com  
PHP

Coding Folders for a PHP Email Application
By: Leidago
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 7
    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:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log 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
     

       

    PHP ARTICLES

    - Getting More Info on Reflected Properties wi...
    - Implementing the Iterator SPL Interface
    - Building a Data Access Layer for the Data Ma...
    - Building a Singleton Database with Restricti...
    - Working with Reflected Properties with the R...
    - The Iterator, Countable and ArrayAccess SPL ...
    - Implementing the Data Mapper Design Pattern ...
    - Defining an Abstract Class with Restrictive ...
    - The Reflection API: Working with Reflected M...
    - Using Restrictive Constructors in PHP 5
    - Getting Information on a Reflected Class wit...
    - Introducing the Reflection API in PHP 5
    - Swift Mailer's Batchsend Method and Other Fe...
    - Embedding Attachments into Email Messages wi...
    - Dynamically Attaching Files with Swift Mailer


    Code Analysis Tools
    Enterprise code analysis tools that deliver quality and reliable code



    © 2003-2010 by Developer Shed. All rights reserved. DS Cluster 8 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek