PHP Classes
elePHPant
Icontem

File: example_genericMail.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Peter Valicek  >  Generic Mail  >  example_genericMail.php  >  Download  
File: example_genericMail.php
Role: Example script
Content type: text/plain
Description: Example Script
Class: Generic Mail
PEAR::Mail wrapper for sending text and HTML mail
Author: By
Last change:
Date: 11 years ago
Size: 697 bytes
 

Contents

Class file image Download
<?php

/***************************
 * Example for genericMail *
 ***************************/

/*
 * Include Class
 */
require_once 'class_genericMail.php';

/*
 * Set Mailsender
 */
$sender = "Superuser <root@example.com>";

/*
 * Set recipient
 */
$rec = array(
   
'to' => 'you@example.com, He <he@example.com>',
    );

/*
 * Set Maildata
 */
$data = array(
   
'subject' => "This is a testmail",
   
'mailtext' => "<h1>Welcome to genericMail.</h1>",
   
'type' => "html",
   
'attachment' => array( 'testfile.html' )
    );

/*
 * Send the Mail
 */
if ( genericMail::sendmail( $sender, $rec, $data ) ) {
    print
"Mail was send successfull ... \n";
} else {
    print
"Hmm .. there could be a Problem ... \n";
}

?>