PHP
  Home arrow PHP arrow Page 2 - PHP Email
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 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Mobile Linux 
App Generation ROI 
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

PHP Email
By: Leidago
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 10
    2006-10-25

    Table of Contents:
  • PHP Email
  • How it Works
  • The Database
  • More Tables

  • 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


    PHP Email - How it Works


    (Page 2 of 4 )

    I will be using PHP's imap functions to write this client. There are over sixty functions available that you can use to create a mail client for both POP3 and IMAP. Visit http://www.php.net/ to see what functions are available. We will be creating a mail client that supports POP3 because it is by far the most popular mail protocol used today. To send an email message with PHP is very simple. You just use PHP's mail() function. The syntax for the function is:

    mail( string to, string subject, string message [, string
    additional_headers [, string additional_parameters]] )

    But because we want to give the user the choice to send attachments with email, we are going to use the freely available PHPMailer class (from http://phpmailer.sourceforge.net ). This class gives us the power to send email messages with all kinds of features, such as attachments, HTML messages or just plain messages. Although I will be using PHPMailer in this article, I will not be using it extensively, so please look at the following sites to learn more about this class:

    Examples - http://phpmailer.sourceforge.net/extending.html

    Tutorial - http://phpmailer.sourceforge.net/tutorial.html

    To retrieve email messages from the mail server, we will be using the @imap_headerinfo() and imap_msgno( ) functions. The imap_headerinfo() function retrieves all the message headers such as from, subject, and so forth, and the imap_msgno() function identifies the message number as it is numbered on the server.

    To connect to the mail server we use the imap_open($mbox, $userid, $userpassword) function. As you can see this function takes three parameters, the mailbox name, the user name and user password.

    The application will provide the ability to do the following:

    • User authentication.
    • Connect to the mail server and download and process messages.
    • Store the messages in the database one by one.
    • Retrieve and display all the newly downloaded messages.

    After the messages are displayed on the index page, the program will give the user the option to view a message (this will lead to the view.php page) or to delete the message.

    More PHP Articles
    More By Leidago


       · This article assumes you are using php on Windows. Good luck getting php imap...
       · Yes i'm using windows on my development machine. Unfortunatly i dont have access to...
       · please continue this php email tutorial.it help me.
       · why assign int (11) for " to "?why assign varchar (200) for "from" ?
     

       

    PHP ARTICLES

    - Working With Different Namespaces in PHP 5
    - User Management Explained: Overview
    - Using Namespaces in PHP 5
    - Database Security: Guarding Against SQL Inje...
    - Building a Modular Exception Class in PHP 5
    - Database and Password Security for Web Appli...
    - Handling MySQL Data Set Failures in PHP 5
    - Building Site Registration for Web Applicati...
    - Intercepting Customized Exceptions in PHP 5
    - Securing Your Web Application Against Attacks
    - Sub Classing Exceptions in PHP 5
    - Authentication for Web Application Security
    - Building a Content Management System with Co...
    - Filters and Login Systems for Web Applicatio...
    - Working with the Email Class in Code Igniter





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
    Stay green...Green IT