Welcome, Guest Log In

Class Krai_Mail

Class Overview

E-Mailing utility

This class is a wrapper around the PEAR Mail class. It can be overriden to provide special functionality. First, it needs to be configured through Krai_Mail::Configure(). After that, you can get a Mail to fill out by calling Krai_Mail::NewMail(). Finally, a Krai_Struct_Mail instance can be sent via Krai_Mail::Send().

Theoretically, php internal mail, sendmail, and smtp sending are all possible, though not thoroughly tested.

Located in /Krai/Mail.php [line 36]



		
				Author(s):
		
API Tags:
Abstract:  

Properties

Methods

[ Top ]
Property Summary
static string   $_CHARSET   Default character set
static string   $_FROM   Default from address
static string   $_FROMNAME   Default sender name
static Mail   $_MAILER   PEAR Mail class instance
static boolean   $_SEND_MAIL   Whether or not to actually send out email

[ Top ]
Method Summary
static void   Configure()   Configure the mailer
static Krai_Struct_Mail   NewMail()   Factory to create a new mail struct
static boolean   Send()   Send (or just process and not send) an email

[ Top ]
Properties
static string   $_CHARSET = "iso-8859-1" [line 89]

Default character set

This holds the default charset in which to send mail. It can be configured in a Krai_Mail::Configure() call inside the Krai_Struct_Mailconf struct passed.

API Tags:
Access:  protected


[ Top ]
static string   $_FROM = "" [line 68]

Default from address

This holds the default address from which to send mail. It can be configured in a Krai_Mail::Configure() call.

API Tags:
Access:  protected


[ Top ]
static string   $_FROMNAME = "" [line 78]

Default sender name

This holds the default name of the sending entity. It can be configured in a Krai_Mail::Configure() call.

API Tags:
Access:  protected


[ Top ]
static Mail   $_MAILER [line 47]

PEAR Mail class instance

This holds an instance of the PEAR Mail class, which is created and configured in Krai_Mail::Configure().

API Tags:
Access:  protected


[ Top ]
static boolean   $_SEND_MAIL = false [line 58]

Whether or not to actually send out email

This is a flag determining whether or not to actually send mail. This lets you turn off mail sending without commenting out all the mailing parts of the application code.

API Tags:
Access:  protected


[ Top ]
Methods
static method Configure  [line 155]

  static void Configure( boolean $_send, string $_from, string $_fromname, Krai_Struct_Mailconf $_backend  )

Configure the mailer

This function lets you configure the mailer options. It should probably only be called once, but that is not enforced in the code. This function sets Krai_Mail::$_SEND_MAIL, Krai_Mail::$_FROM, Krai_Mail::$_FROMNAME, and Krai_Mail::$_MAILER

Parameters:
boolean   $_send:  Whether or not to send mail
string   $_from:  From address
string   $_fromname:  From name
Krai_Struct_Mailconf   $_backend:  The mailer backend configuration

API Tags:
Access:  public

Information Tags:
Throws:  Krai_Mail_Exception

[ Top ]
static method NewMail  [line 99]

  static Krai_Struct_Mail NewMail( )

Factory to create a new mail struct

This function generates and returns a new Krai_Struct_Mail instance, which represents a mail that will later be sent.


API Tags:
Access:  public


[ Top ]
static method Send  [line 113]

  static boolean Send( Krai_Struct_Mail &$mail, Krai_Struct_Mail $mail  )

Send (or just process and not send) an email

This function processes a Krai_Struct_Mail and attempts to send it if emailing is turned on.

Parameters:
Krai_Struct_Mail   $mail:  The email to send
Krai_Struct_Mail   &$mail: 

API Tags:
Return:  The success of the mailing attempt
Access:  public


[ Top ]

Documentation generated on Fri, 25 Jul 2008 15:19:35 -0400 by phpDocumentor 1.4.2
Krai Framework site admin credits sitemap valid xhtml?