PHP Classes
Icontem

File: mail_test.class.php


  Search   All class groups All class groups   Latest entries Latest entries   Top 10 charts Top 10 charts   Newsletter Newsletter   Blog Blog   Forums Forums   Help FAQ Help FAQ  
  Login   Register  
Recommend this page to a friend! ReTweet ReTweet Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Nicola Antonio Filannino  >  Email class  >  mail_test.class.php  
File: mail_test.class.php
Role: Example script
Content type: text/plain
Description: Watch the class at work
Class: Email class
Sent text or HTML e-mail messages using templates
 

Contents

Class file image Download
<?
/*    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    Date: 20 Dec 2005
    Author: Nicola Antonio Filannino
    Nation: Italy
    City: Barletta (Ba)

    Description:
        This class let you send e-mail messages from your PHP pages. 

    Features:
        1. Switching between HTML and PLAIN format of the messages
        2. Usage of e-mail template to send HTML formatted e-mail
        3. Scalable number of e-mail template vars
    
    Important: 
        You can create a brand new Template, starting from a simple static HTML page.
        There put the variables parts in this format #VARIABLE_NAME#, after this fill the $mail->template_vars with an array
        as in the example whose keys are the name of the vars in the template.
    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
*/
    




include ("email.class.php");

//######################Email class usage#############################################################################
    
$mail = new Email "mail_from@site.com",        //From e-mail box
                        
"mail_to_someone@site.com",    //Recipients (semicolon ';' separated)
                        
"Subject"            //Subject
            
);
//####################################################################################################################

$mail->template "mail_template.html";            //Email template fillable with others variables of the same kind of ones inside.

//The array holds the settings for the template
    
$mail->template_vars = array ( 
                                
"#USERNAME#" => "Peter North",
                                
"#GFX#" => "PATH_TO_GIF"
            
);

//We send the e-mail here!!
    
$mail->send ();




?><html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>

<body>
</body>
</html>

 
  Advertise on this site Advertise on this site   Site map Site map   Statistics Statistics   Site tips Site tips   Privacy policy Privacy policy   Contact Contact  

For more information send a message to :
info at phpclasses dot org.
Copyright (c) Icontem 1999-2009 PHP Classes - PHP Class Scripts
  PHP Book Reviews - Reviews of books and other products