PHP Class Pop\Mail\Mail

Author: Nick Sagona, III ([email protected])
ファイルを表示 Open project: nicksagona/PopPHP Class Usage Examples

Protected Properties

Property Type Description
$attachments array File attachments
$group boolean Send as group flag
$headers array Mail headers
$message Message Message body
$params string Mail parameters
$queue Queue Sending queue
$subject string Subject

Public Methods

Method Description
__construct ( string $subj = null, mixed $rcpts = null ) : Mail Constructor
add ( string $email, string $name = null ) : Mail Add a recipient to the queue
addRecipients ( mixed $rcpts ) : Mail Add recipients to the queue
attachFile ( string $file ) : Mail Attach a file to the mail object.
bcc ( string $email, string $name = null ) : Mail Alias to set the bcc headers
cc ( string $email, string $name = null ) : Mail Alias to set the cc headers
from ( string $email, string $name = null, boolean $replyTo = true ) : Mail Alias to set the from and reply-to headers
getAttachments ( ) : array Get attachments
getBoundary ( ) : string Get MIME boundary
getCharset ( ) : string Get character set
getEol ( ) : string Get EOL
getHeader ( string $name ) : string Get the mail header
getHeaders ( ) : array Get the mail header
getHtml ( ) : string Get HTML part of the message.
getMessage ( ) : Message Get the mail message
getQueue ( ) : Queue Get the mail queue
getSubject ( ) : string Get the subject
getText ( ) : string Get text part of the message.
replyTo ( string $email, string $name = null, boolean $from = true ) : Mail Alias to set the reply-to and from headers
saveTo ( string $to = null, string $format = null ) : Mail Save mail message or messages in a folder to be sent at a later date.
send ( ) : void Send mail message or messages.
sendAsGroup ( boolean $group ) : Mail Set the send as group flag
sendFrom ( string $from = null, boolean $delete = false ) : Mail Send mail message or messages that are saved in a folder.
setBoundary ( string $bnd = null ) : Mail Set MIME boundary
setCharset ( string $chr ) : Mail Set character set
setEol ( string $eol = Mail::CRLF ) : Mail Set EOL
setHeader ( string $name, string $value ) : Mail Set a mail header
setHeaders ( array $headers ) : Mail Set mail headers
setHtml ( string $html ) : Mail Set HTML part of the message.
setParams ( mixed $params = null ) : Mail Set parameters
setSubject ( string $subj ) : Mail Set the subject
setText ( string $text ) : Mail Set text part of the message.
to ( string $email, string $name = null ) : Mail Alias to add a recipient to the queue

Protected Methods

Method Description
buildHeaders ( ) : string Build headers
getEmailFromFile ( string $filename ) : array Get email data from file

Method Details

__construct() public method

Instantiate the mail object.
public __construct ( string $subj = null, mixed $rcpts = null ) : Mail
$subj string
$rcpts mixed
return Mail

add() public method

Add a recipient to the queue
public add ( string $email, string $name = null ) : Mail
$email string
$name string
return Mail

addRecipients() public method

Add recipients to the queue
public addRecipients ( mixed $rcpts ) : Mail
$rcpts mixed
return Mail

attachFile() public method

Attach a file to the mail object.
public attachFile ( string $file ) : Mail
$file string
return Mail

bcc() public method

Alias to set the bcc headers
public bcc ( string $email, string $name = null ) : Mail
$email string
$name string
return Mail

buildHeaders() protected method

Build headers
protected buildHeaders ( ) : string
return string

cc() public method

Alias to set the cc headers
public cc ( string $email, string $name = null ) : Mail
$email string
$name string
return Mail

from() public method

Alias to set the from and reply-to headers
public from ( string $email, string $name = null, boolean $replyTo = true ) : Mail
$email string
$name string
$replyTo boolean
return Mail

getAttachments() public method

Get attachments
public getAttachments ( ) : array
return array

getBoundary() public method

Get MIME boundary
public getBoundary ( ) : string
return string

getCharset() public method

Get character set
public getCharset ( ) : string
return string

getEmailFromFile() protected method

Get email data from file
protected getEmailFromFile ( string $filename ) : array
$filename string
return array

getEol() public method

Get EOL
public getEol ( ) : string
return string

getHeader() public method

Get the mail header
public getHeader ( string $name ) : string
$name string
return string

getHeaders() public method

Get the mail header
public getHeaders ( ) : array
return array

getHtml() public method

Get HTML part of the message.
public getHtml ( ) : string
return string

getMessage() public method

Get the mail message
public getMessage ( ) : Message
return Message

getQueue() public method

Get the mail queue
public getQueue ( ) : Queue
return Queue

getSubject() public method

Get the subject
public getSubject ( ) : string
return string

getText() public method

Get text part of the message.
public getText ( ) : string
return string

replyTo() public method

Alias to set the reply-to and from headers
public replyTo ( string $email, string $name = null, boolean $from = true ) : Mail
$email string
$name string
$from boolean
return Mail

saveTo() public method

Save mail message or messages in a folder to be sent at a later date.
public saveTo ( string $to = null, string $format = null ) : Mail
$to string
$format string
return Mail

send() public method

This method depends on the server being set up correctly as an SMTP server and sendmail being correctly defined in the php.ini file.
public send ( ) : void
return void

sendAsGroup() public method

Set the send as group flag
public sendAsGroup ( boolean $group ) : Mail
$group boolean
return Mail

sendFrom() public method

This method depends on the server being set up correctly as an SMTP server and sendmail being correctly defined in the php.ini file.
public sendFrom ( string $from = null, boolean $delete = false ) : Mail
$from string
$delete boolean
return Mail

setBoundary() public method

Set MIME boundary
public setBoundary ( string $bnd = null ) : Mail
$bnd string
return Mail

setCharset() public method

Set character set
public setCharset ( string $chr ) : Mail
$chr string
return Mail

setEol() public method

Set EOL
public setEol ( string $eol = Mail::CRLF ) : Mail
$eol string
return Mail

setHeader() public method

Set a mail header
public setHeader ( string $name, string $value ) : Mail
$name string
$value string
return Mail

setHeaders() public method

Set mail headers
public setHeaders ( array $headers ) : Mail
$headers array
return Mail

setHtml() public method

Set HTML part of the message.
public setHtml ( string $html ) : Mail
$html string
return Mail

setParams() public method

Set parameters
public setParams ( mixed $params = null ) : Mail
$params mixed
return Mail

setSubject() public method

Set the subject
public setSubject ( string $subj ) : Mail
$subj string
return Mail

setText() public method

Set text part of the message.
public setText ( string $text ) : Mail
$text string
return Mail

to() public method

Alias to add a recipient to the queue
public to ( string $email, string $name = null ) : Mail
$email string
$name string
return Mail

Property Details

$attachments protected_oe property

File attachments
protected array $attachments
return array

$group protected_oe property

Send as group flag
protected bool $group
return boolean

$headers protected_oe property

Mail headers
protected array $headers
return array

$message protected_oe property

Message body
protected Message,Pop\Mail $message
return Message

$params protected_oe property

Mail parameters
protected string $params
return string

$queue protected_oe property

Sending queue
protected Queue,Pop\Mail $queue
return Queue

$subject protected_oe property

Subject
protected string $subject
return string