PHP Classes

File: readthis.txt

Recommend this page to a friend!
  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: 11 years ago
Size: 1,411 bytes


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','')); $mail->address('to', array( array('Barry Danen1',''), array('G Danen2',''), array('Adri Danen',''), )); $mail->address('to', array('Test Danen','')); $mail->address('bcc', array('Danen, G','')); 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