PHP Class GBMail, gitblog

Configuration is stored in data/email.json. Example of Google Mail SMTP delivery: { "admin": ["Your Self", "[email protected]"], "smtp": { "secure": "ssl", "host": "smtp.gmail.com", "port": 465, "username": "[email protected]", "password": "secret" } } Example of sending mail using the convenience method "compose": GBMail::compose('Hello', 'This is a mail', array('John Doe', '[email protected]'))->send();
Show file Open project: rsms/gitblog Class Usage Examples

Public Properties

Property Type Description
$conf
$default_from
$mailer

Public Methods

Method Description
__construct ( $subject = null, $textbody = null )
addAddress ( $var, $type = 'to' )
authorizedFromAddress ( )
compose ( $subject, $textbody, $to = null, $from = null )
formatAddress ( $addr )
mkmailer ( )
needAuthorizedFromAddress ( )
normalizeRecipient ( $v ) # returns array(addr, name | "")
rawRecipients ( )
send ( $deferred = null ) Send the mail.
setDefaultConfig ( )
setFrom ( $var )

Method Details

__construct() public method

public __construct ( $subject = null, $textbody = null )

addAddress() public method

public addAddress ( $var, $type = 'to' )

authorizedFromAddress() public method

compose() static public method

static public compose ( $subject, $textbody, $to = null, $from = null )

formatAddress() public method

public formatAddress ( $addr )

mkmailer() static public method

static public mkmailer ( )

needAuthorizedFromAddress() public method

normalizeRecipient() static public method

# returns array(addr, name | "")
static public normalizeRecipient ( $v )

rawRecipients() public method

public rawRecipients ( )

send() public method

$deferred defaults to true if delivery subsystem is SMTP, otherwise default is false (not using delay execution).
public send ( $deferred = null )

setDefaultConfig() static public method

static public setDefaultConfig ( )

setFrom() public method

public setFrom ( $var )

Property Details

$conf public static property

public static $conf

$default_from public static property

public static $default_from

$mailer public property

public $mailer