Open Monograph Press  1.1
 All Classes Namespaces Functions Variables Groups Pages
Mail Class Reference
Inheritance diagram for Mail:
DataObject MailTemplate MassMail SubmissionMailTemplate MonographMailTemplate

Public Member Functions

 addAttachment ($filePath, $fileName= '', $contentType= '', $contentDisposition= 'attachment')
 
 addBcc ($email, $name= '')
 
 addCc ($email, $name= '')
 
 addHeader ($name, $content)
 
 addPrivateParam ($name, $value)
 
 addRecipient ($email, $name= '')
 
 clearAllRecipients ()
 
 encodeDisplayName ($displayName, $send=false)
 
 getAddressArrayString ($addresses, $includeNames=true, $send=false)
 
getAttachments ()
 
 getBccs ()
 
 getBccString ()
 
 getBody ()
 
 getCcs ()
 
 getCcString ()
 
 getContentType ()
 
 getEnvelopeSender ()
 
 getFrom ()
 
 getFromString ($send=false)
 
 getHeaders ()
 
 getRecipients ()
 
 getRecipientString ()
 
 getReplyTo ()
 
 getSubject ()
 
 hasAttachments ()
 
 Mail ()
 
 promoteCcsIfNoRecipients ()
 
 send ()
 
 setBccs ($bccs)
 
 setBody ($body)
 
 setCcs ($ccs)
 
 setContentType ($contentType)
 
 setEnvelopeSender ($envelopeSender)
 
 setFrom ($email, $name= '')
 
 setHeaders (&$headers)
 
 setPrivateParams ($privateParams)
 
 setRecipients ($recipients)
 
 setReplyTo ($email, $name= '')
 
 setSubject ($subject)
 
- Public Member Functions inherited from DataObject
 addSupportedMetadataAdapter ($metadataAdapter)
 
 DataObject ()
 
 extractMetadata ($metadataSchema)
 
 getAdditionalMetadataFieldNames ()
 
getAllData ()
 
getData ($key, $locale=null)
 
 getHasLoadableAdapters ()
 
 getId ()
 
 getLocaleMetadataFieldNames ()
 
getLocalizedData ($key)
 
 getMetadataFieldNames ($translated=true)
 
 getSetMetadataFieldNames ($translated=true)
 
 getSupportedExtractionAdapters ()
 
 getSupportedInjectionAdapters ()
 
 getSupportedMetadataSchemas ()
 
 hasData ($key, $locale=null)
 
 injectMetadata ($metadataDescription)
 
 removeSupportedMetadataAdapter ($metadataSchemaName)
 
 setAllData (&$data)
 
 setData ($key, $value, $locale=null)
 
 setHasLoadableAdapters ($hasLoadableAdapters)
 
 setId ($id)
 
 upcastTo ($targetObject)
 

Public Attributes

 $privateParams
 
- Public Attributes inherited from DataObject
 $_data = array()
 
 $_extractionAdaptersLoaded = false
 
 $_hasLoadableAdapters = false
 
 $_injectionAdaptersLoaded = false
 
 $_metadataExtractionAdapters = array()
 
 $_metadataInjectionAdapters = array()
 

Detailed Description

Class defining basic operations for handling and sending emails.

Definition at line 24 of file Mail.inc.php.

Member Function Documentation

Mail::addAttachment (   $filePath,
  $fileName = '',
  $contentType = '',
  $contentDisposition = 'attachment' 
)

Adds a file attachment to the email.

Parameters
$filePathstring complete path to the file to attach
$fileNamestring attachment file name (optional)
$contentTypestring attachment content type (optional)
$contentDispositionstring attachment content disposition, inline or attachment (optional, default attachment)

Definition at line 256 of file Mail.inc.php.

Mail::addBcc (   $email,
  $name = '' 
)

Add a blind carbon copy (BCC) recipient to the message.

Parameters
$emailstring
$nameoptional

Definition at line 157 of file Mail.inc.php.

Mail::addCc (   $email,
  $name = '' 
)

Add a carbon-copy (CC) recipient to the message.

Parameters
$emailstring
$namestring optional

Definition at line 127 of file Mail.inc.php.

Mail::addHeader (   $name,
  $content 
)

Add an SMTP header to the message.

Parameters
$namestring
$contentstring

Definition at line 212 of file Mail.inc.php.

Mail::addPrivateParam (   $name,
  $value 
)

Add a private parameter to this email. Private parameters are replaced just before sending and are never available via getBody etc.

Definition at line 47 of file Mail.inc.php.

References $privateParams.

Mail::addRecipient (   $email,
  $name = '' 
)

Add a recipient.

Parameters
$emailstring
$namestring optional

Definition at line 64 of file Mail.inc.php.

Referenced by MassMail\send().

Mail::clearAllRecipients ( )

Clear all recipients for this message (To, CC, and BCC).

Definition at line 201 of file Mail.inc.php.

Referenced by MassMail\send().

Mail::encodeDisplayName (   $displayName,
  $send = false 
)

Encode a display name for proper inclusion with an email address.

Parameters
$displayNamestring
$sendboolean True to encode the results for sending
Returns
string

Definition at line 514 of file Mail.inc.php.

Referenced by Submission\getAuthorEmails().

Mail::getAddressArrayString (   $addresses,
  $includeNames = true,
  $send = false 
)

Return a string from an array of (name, email) pairs.

Parameters
$includeNamesboolean
Returns
string;

Definition at line 384 of file Mail.inc.php.

Referenced by getCcString(), and getRecipientString().

& Mail::getAttachments ( )

Get the attachments currently on the message.

Returns
array

Definition at line 285 of file Mail.inc.php.

Mail::getBccs ( )

Get the blind carbon copy (BCC) recipients for the message

Returns
array

Definition at line 170 of file Mail.inc.php.

References DataObject\setData().

Referenced by getCcString().

Mail::getBccString ( )

Return a string containing the Bcc recipients.

Returns
string

Definition at line 428 of file Mail.inc.php.

References HookRegistry\call().

Mail::getBody ( )

Get the body of the message.

Returns
string

Definition at line 362 of file Mail.inc.php.

References getFrom().

Referenced by MassMail\send().

Mail::getCcs ( )

Get the carbon-copy (CC) recipients for the message.

Returns
array

Definition at line 140 of file Mail.inc.php.

References DataObject\setData().

Referenced by getRecipientString(), and setBccs().

Mail::getCcString ( )

Return a string containing the Cc recipients.

Returns
string

Definition at line 420 of file Mail.inc.php.

References getAddressArrayString(), and getBccs().

Mail::getContentType ( )

Get the message content type (MIME)

Returns
string

Definition at line 94 of file Mail.inc.php.

References DataObject\setData().

Mail::getEnvelopeSender ( )

Get the envelope sender (bounce address) for the message, if set.

Returns
string

Definition at line 86 of file Mail.inc.php.

References DataObject\getData().

Mail::getFrom ( )

Get the sender of the message.

Returns
array

Definition at line 312 of file Mail.inc.php.

References DataObject\setData().

Referenced by getBody().

Mail::getFromString (   $send = false)

Return a string containing the from address.

Returns
string

Definition at line 370 of file Mail.inc.php.

Mail::getHeaders ( )

Get the SMTP headers for the message.

Returns
array

Definition at line 237 of file Mail.inc.php.

References DataObject\setData().

Mail::getRecipients ( )

Get the recipients for the message.

Returns
array

Definition at line 110 of file Mail.inc.php.

References DataObject\setData().

Referenced by MassMail\send(), and setBccs().

Mail::getRecipientString ( )

Return a string containing the recipients.

Returns
string

Definition at line 412 of file Mail.inc.php.

References getAddressArrayString(), and getCcs().

Mail::getReplyTo ( )

Get the reply-to of the message.

Returns
array

Definition at line 330 of file Mail.inc.php.

References DataObject\setData().

Mail::getSubject ( )

Get the subject of the message.

Returns
string

Definition at line 346 of file Mail.inc.php.

References DataObject\setData().

Referenced by MassMail\send().

Mail::hasAttachments ( )

Return true iff attachments are included in this message.

Returns
boolean

Definition at line 294 of file Mail.inc.php.

Mail::Mail ( )

Constructor.

Definition at line 34 of file Mail.inc.php.

References Config\getVar(), and setEnvelopeSender().

Mail::promoteCcsIfNoRecipients ( )

If no recipients for this message, promote CC'd accounts to recipients. If recipients exist, no effect.

Returns
boolean true iff CCs were promoted

Definition at line 187 of file Mail.inc.php.

References setCcs(), and setRecipients().

Mail::send ( )

Send the email.

Returns
boolean

Definition at line 437 of file Mail.inc.php.

Referenced by MassMail\send().

Mail::setBccs (   $bccs)

Set the blind carbon copy (BCC) recipients for the message.

Parameters
$bccsarray

Definition at line 178 of file Mail.inc.php.

References getCcs(), and getRecipients().

Mail::setBody (   $body)

Set the body of the message.

Parameters
$bodystring

Definition at line 354 of file Mail.inc.php.

References DataObject\getData().

Referenced by MassMail\send().

Mail::setCcs (   $ccs)

Set the carbon-copy (CC) recipients for the message.

Parameters
$ccsarray

Definition at line 148 of file Mail.inc.php.

References DataObject\getData().

Referenced by promoteCcsIfNoRecipients().

Mail::setContentType (   $contentType)

Set the message content type (MIME)

Parameters
$contentTypestring

Definition at line 102 of file Mail.inc.php.

References DataObject\getData().

Mail::setEnvelopeSender (   $envelopeSender)

Set the envelope sender (bounce address) for the message, if supported.

Parameters
$envelopeSenderstring Email address

Definition at line 78 of file Mail.inc.php.

References DataObject\getData().

Referenced by Mail().

Mail::setFrom (   $email,
  $name = '' 
)

Set the sender of the message.

Parameters
$emailstring
$namestring optional

Definition at line 304 of file Mail.inc.php.

References DataObject\getData().

Mail::setHeaders ( $headers)

Set the SMTP headers for the message.

Parameters
$headersarray

Definition at line 245 of file Mail.inc.php.

References DataObject\getData().

Mail::setPrivateParams (   $privateParams)

Set the entire list of private parameters.

See Also
addPrivateParam

Definition at line 55 of file Mail.inc.php.

References DataObject\getData().

Mail::setRecipients (   $recipients)

Set the recipients for the message.

Parameters
$recipientsarray

Definition at line 118 of file Mail.inc.php.

References DataObject\getData().

Referenced by promoteCcsIfNoRecipients(), and MassMail\send().

Mail::setReplyTo (   $email,
  $name = '' 
)

Set the reply-to of the message.

Parameters
$emailstring or null to clear
$namestring optional

Definition at line 321 of file Mail.inc.php.

Mail::setSubject (   $subject)

Set the subject of the message.

Parameters
$subjectstring

Definition at line 338 of file Mail.inc.php.

References DataObject\getData().

Referenced by MassMail\send().

Member Data Documentation

array Mail::$privateParams

List of key => value private parameters for this message

Definition at line 29 of file Mail.inc.php.

Referenced by addPrivateParam().


The documentation for this class was generated from the following file: