Login   Register  
PHP Classes
elePHPant
Icontem

File: ex_email.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Danny Tucker  >  EZ Framework  >  ex_email.php  >  Download  
File: ex_email.php
Role: Example script
Content type: text/plain
Description: Example
Class: EZ Framework
Framework providing several types of functionality
Author: By
Last change:
Date: 8 years ago
Size: 1,012 bytes
 

Contents

Class file image Download
<?php
# Version 1.0
require_once('../include/config.inc.php');

$email = new email();

# At minimum you only need a from,to,subject,body

// From e-mail
$email->setFrom('someone@somedomain.com','Senders Name');

// To e-mail
$email->addTo('someone@somedomain.com','Receivers Name');

// Add CC
$email->addCc('someone@somedomain.com','name');

// Add BCC
$email->addBcc('someone@somedomain.com','name');

// Add more headers
$email->addHeader('header name','header value');

// Set charset
$email->setCharset('');

// Set encoding
$email->setEncodingBit('');

// Generate Header for EML format
$email->exportEML();

// subject
$email->setSubject('Did this email work?');

// body + html
$email->setBodyHTML('This is my <b>bold</b> tag.');

// body no html
$email->setBodyText('no html');

// attach a file
$email->addAttachLocalFile('files/happy/me.jpg');

// attach a uploaded file
$email->addAttachPOSTFile($_FILES);

// Send email
$sent $email->send();

?>