PHP Classes

File: exemple

Recommend this page to a friend!
  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: 12 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';
?>