Login   Register  
PHP Classes
elePHPant
Icontem

File: readthis.txt

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Gerry Danen  >  Danen Email  >  readthis.txt  >  Download  
File: readthis.txt
Role: Documentation
Content type: text/plain
Description: How to use
Class: Danen Email
Compose and send text and HTML e-mail messages
Author: By
Last change:
Date: 2011-05-29 17:19
Size: 1,411 bytes
 

Contents

Class file image Download
This class can send both HTML and TEXT emails.

Email addresses are passed as arrays with name and email address pairs, for example:

	$mail->address('to', array('Gerry Danen','gerry@danen.com'));
	$mail->address('to', array(
							array('Barry Danen1','barry.danen@thermam.com'),
							array('G Danen2','gerry.danen@thermam.com'),
							array('Adri Danen','a.danen@thermam.com'),
						));
	$mail->address('to', array('Test Danen','test@gmail.com'));
	$mail->address('bcc', array('Danen, G','gdanen@thermam.com'));

All addresses passed in this manner are used. For the sender/from and "reply to" addresses,
only the last one is used.

Subject and message are set with very simple calls:

	$mail->subject("A Real Big Issue");
	$mail->message("<p>Message line 1\nLine 2\nLine 3\nThis is an 
					<span style='color: #CC1F1F;'><strong>html</strong></span> 
					message.</p>");

Note that the message is broken up for readability, but should really be one big line.

Font size, family, and color can be changed from the default. If you like the default,
no need to supply it. To get large print:

	$mail->style('fontsize', '2em');

Now you can send the message (default is html):

	$mail->send();

The send method returns true or false to indicate failure.


Credit:
-Idea to UTF-8 encode from Gilton Guma (Brasil)


Gerry Danen
gdanen at gmail dot com
29 May 2011