Class Mail_Mailer

Description

This class is designed to allow users to easily send both TEXT and HTML email messages.

Handles plain-text, html email, and attachments via Mail_Mime.

Located in /framework/Mailer.php (line 45)


	
			
Variable Summary
Method Summary
static $ok emailOK ($addr $addr)
Mail_Mailer __construct ([$driver $driver = 'smtp'], [$config $config = NULL])
void addAttachment ($filepath $filepath, [$filetype $filetype = 'application/octet-stream'], [$name $name = ''])
void addAttachmentStream ($file $filedata, [$filetype $filetype = 'application/octet-stream'], [$name $name = ''])
addBCCEmail ($bcc $bcc)
addCCEmail ($cc $cc)
err send ()
void setBCCSender ($bcc_sender $bcc_sender)
$err setFromEmail ($from_email $from_email)
void setFromName ($from_name $from_name)
void setMessageHTML ($html $html_msg)
void setMessageTEXT ($msg $msg)
$err setPriority ($priority $priority)
$err setReplyToEmail ($reply_to_email $reply_to_email)
void setSubject ($subj $subj)
$err setToEmail ($to $to)
void setToName ($to $to)
Variables
array $attachments (line 94)
  • var: An array of attachments.
  • access: protected
array $bcc_list (line 74)
  • var: A list of all people to BCC.
  • access: protected
boolean $bcc_sender (line 70)
  • var: TRUE to BCC the sender.
  • access: protected
array $cc_list (line 78)
  • var: A list of all people to CC.
  • access: protected
string $from_email (line 66)
  • var: FROM email address.
  • access: protected
string $from_name (line 62)
  • var: FROM name.
  • access: protected
array $pear_mailer_config (line 50)
  • var: An array of options for the pear_mailer_driver.
  • access: protected
string $pear_mailer_driver (line 54)
  • var: The Mail driver backend.
  • access: protected
integer $priority (line 90)
  • var: Priority of the message, from 1 (high priority) to 5 (low priority). Default is 3 (normal).
  • access: protected
string $raw_message_html (line 98)
  • var: The HTML message.
  • access: protected
string $raw_message_text (line 102)
  • var: The TEXT message.
  • access: protected
string $reply_to_email (line 86)
  • var: The Reply-To email address.
  • access: protected
string $subject (line 82)
  • var: The subject of the message.
  • access: protected
string $to_email (line 58)
  • var: TO email address.
  • access: protected
Methods
static method emailOK (line 418)

Verify an email addresses well-formedness.

  • return: boolean True if email is valid, false otherwise.
static $ok emailOK ($addr $addr)
  • $addr $addr: string Email address to check.
Constructor __construct (line 112)

Constructor. Initializes object.

See PEAR Mail config for info on the what the parameters do.

Mail_Mailer __construct ([$driver $driver = 'smtp'], [$config $config = NULL])
  • $driver $driver: string The PEAR Mail backend to use. One of smtp, sendmail, or mail. DEFAULT is smtp. OPTIONAL.
  • $config $config: array A PEAR Mail compatible config array. By default, will use local SMTP connection. OPTIONAL.
addAttachment (line 305)

Add an attachment from a file.

void addAttachment ($filepath $filepath, [$filetype $filetype = 'application/octet-stream'], [$name $name = ''])
  • $filepath $filepath: string The path to the file to attach
  • $filetype $filetype: string The mime type of the file. defaults to 'application/octet-stream'
  • $name $name: string The name of the attachment. defaults to ''.
addAttachmentStream (line 294)

Add an attachment from a stream of data.

void addAttachmentStream ($file $filedata, [$filetype $filetype = 'application/octet-stream'], [$name $name = ''])
  • $file $filedata: string The file data stream
  • $filetype $filetype: string The mime type of the file. defaults to 'application/octet-stream'
  • $name $name: string The name of the attachment. defaults to ''.
addBCCEmail (line 166)

Add an email to the BCC list.

  • return: on success, a PEAR error if the email is not valid.
0 addBCCEmail ($bcc $bcc)
  • $bcc $bcc: Email address.
addCCEmail (line 148)

Add an email to the CC list.

  • return: on success, a PEAR error if the email is not valid.
0 addCCEmail ($cc $cc)
  • $cc $cc: Email address.
send (line 314)

Send the email out.

  • return: 0 if no error; otherwise a PEAR_Error object with the error.
err send ()
setBCCSender (line 137)

Set a flag to BCC the sender.

void setBCCSender ($bcc_sender $bcc_sender)
  • $bcc_sender $bcc_sender: boolean
setFromEmail (line 217)

Set the FROM address for the email.

  • return: int 0 if no error, PEAR error if email is not valid.
$err setFromEmail ($from_email $from_email)
  • $from_email $from_email: string Properly formatted email.
setFromName (line 207)

Set the FROM NAME for the email.

void setFromName ($from_name $from_name)
  • $from_name $from_name: string From name
setMessageHTML (line 274)

Set the HTML for the message.

void setMessageHTML ($html $html_msg)
  • $html $html_msg: string HTML to use for HTML portion of message.
setMessageTEXT (line 283)

If just a simple message is desired to be sent, the caller can use this function.

void setMessageTEXT ($msg $msg)
  • $msg $msg: string - the BODY of the email.
setPriority (line 250)

Set the priority of the message.

  • return: int 0 if no error, 1 if error (illegal priority value)
$err setPriority ($priority $priority)
  • $priority $priority: int Priority from 1 to 5, 1 is MOST IMPORTANT.
setReplyToEmail (line 233)

Set the REPLY TO address for the email.

  • return: int 0 if no error, 1 if error (malformed email)
$err setReplyToEmail ($reply_to_email $reply_to_email)
  • $reply_to_email $reply_to_email: string Properly formatted email.
setSubject (line 265)

Set the subject line of the message.

void setSubject ($subj $subj)
  • $subj $subj: string The subject.
setToEmail (line 192)

Set the TO address for the email.

  • return: int 0 if no error, PEAR error if email is not valid.
$err setToEmail ($to $to)
  • $to $to: string Properly formatted email.
setToName (line 181)

Set the TO NAME for the email.

void setToName ($to $to)
  • $to $to: string NAME of the person being sent to.

Documentation generated on Thu, 17 Apr 2008 13:51:28 -0400 by phpDocumentor 1.4.1