PHP
  Home arrow PHP arrow Page 3 - Working with the Email Class in Code Igniter
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? 
PHP

Working with the Email Class in Code Igniter
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 3
    2008-10-01


    Table of Contents:
  • Working with the Email Class in Code Igniter
  • Sending email with Code Igniter
  • Defining a simple view file
  • Sending email messages via an HTML form

  • 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


    Working with the Email Class in Code Igniter - Defining a simple view file
    ( Page 3 of 4 )

    In the section that you just read, I showed you how to build a basic controller class, which was provided with the capacity to send email messages in a simple fashion. Nonetheless, we need to construct the important part of the program that indicates to the user whether or not the message has been successfully dispatched.

    To perform this task, I’m going to create a primitive view file, whose signature will look as simple as this:

    <html>

    <head>

    <title><?php echo $title;?></title>

    </head>

    <body>

    <h1><?php echo $header;?></h1>

    <p><?php echo $message;?></p>

    </body>

    </html>

    Undoubtedly, the structure of the view file shown above is extremely simplistic. As you can see, this view, aside from displaying the title along with a simple header, will show an additional message on screen which indicates that the email message has been successfully submitted, or in the worst case, that it failed to be dispatched.

    It would also be possible to create two different views, where each of them would be used by the previous controller to display en error string or a confirmation message. However, in this case I decided to code only one view file to keep the example rather simple to follow.

    So far, so good. At this point I've demonstrated how to use Code Igniter to develop a simple email application, whose structure has been built around the schema imposed by the MVC pattern. So, what comes next?

    In the following section I’m going to explain how to take advantage once again of the email class that comes included with Code Igniter. In this case, we'll build a PHP program that sends email using the data entered in a simple HTML form.

    To learn how this sample email application will be developed, you’ll have to click on the link shown below and keep reading.



     
     
    >>> More PHP Articles          >>> More By Alejandro Gervasio
     

       

    PHP ARTICLES

    - Building Dynamic Queries with Chainable Meth...
    - PHP Encryption and Decryption Methods
    - Building a MySQL Abstraction Class with Meth...
    - Completing a Sample String Processor with Me...
    - Mastering WHILE Loops for PHP and MySQL
    - Method Chaining: Adding More Methods to the ...
    - Method Chaining in PHP 5
    - The Role of Interfaces in Applying the Depen...
    - Dependency Injection: Using a Setter Method ...
    - Using a Model Class with the Dependency Inje...
    - Injecting Objects Using Setter Methods with ...
    - Injecting Objects by Constructor with the De...
    - The Dependency Injection Design Pattern in P...
    - Performing Inferential Statistical Analysis ...
    - Performing Descriptive Statistical Analysis ...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 6 Hosted by Hostway
    Stay green...Green IT