Login   Register  
PHP Classes
elePHPant
Icontem

File: exemple

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Italo Lelis de Vietro  >  Easy Email  >  exemple  >  Download  
File: exemple
Role: Example script
Content type: text/plain
Description: A exemple of how to use the easy_email class
Class: Easy Email
Compose and send text and HTML e-mail messages
Author: By
Last change: Camel Case
Date: 2 years ago
Size: 1,026 bytes
 

Contents

Class file image Download
<?php

/**
 * How to use the easy_class
 * @copyright Lellys inform├ítica
 */
include_once 'easy_email.php';
//or you can use the last version of my class like this: include_once 'http://www.lellysinformatica.com/php/easy_email.php';
//The email's subject
$subject "Test Subject";

//The email's message
$msg "<html>
        <body>
        <h3>Test Message</h3>
        </body>
        </html>"
;

//Inicialize a new easy_email object 
$easy_email = new EasyEmail('destination@exemple.com''fromemail@exemple.com');

/*
 * You can customize you email like this:
 * 
 * $easy_email->setIsHTML = true;  This will tell the email to include or not the HTML body on the header. The default is true.
 * $easy_email->setShowFrom = true; This will show the sender in the destination's mailbox. The default is true.
 */

$easy_email->sendEmail($subject$msg); //Send the email

//We verify if the email was succefull sent
if ($easy_email->getIsSent())
    echo 
'Sent';
else
    echo 
'Fail';
?>