Open Journal Systems  2.4.8
 All Classes Namespaces Functions Variables Groups Pages
Mail Class Reference
Inheritance diagram for Mail:
DataObject PKPMailTemplate MailTemplate ArticleMailTemplate MassMail

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 ()
 
 getReplyToString ($send=false)
 
 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 ($callHooks=true)
 
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)
 

Additional Inherited Members

- Public Attributes inherited from DataObject
 $_data = 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 258 of file Mail.inc.php.

References DataObject\getData(), String\mime_content_type(), and DataObject\setData().

Referenced by PKPMailTemplate\send().

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

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

Parameters
$emailstring
$nameoptional

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

References DataObject\getData(), and DataObject\setData().

Referenced by PKPMailTemplate\send().

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

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

Parameters
$emailstring
$namestring optional

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

References DataObject\getData(), and DataObject\setData().

Mail::addHeader (   $name,
  $content 
)

Add an SMTP header to the message.

Parameters
$namestring
$contentstring

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

References DataObject\getData(), and DataObject\setData().

Referenced by send().

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 44 of file Mail.inc.php.

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

Add a recipient.

Parameters
$emailstring
$namestring optional

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

References DataObject\getData(), and DataObject\setData().

Referenced by MassMail\send().

Mail::clearAllRecipients ( )

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

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

References setBccs(), setCcs(), and setRecipients().

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 605 of file Mail.inc.php.

References String\encode_mime_header(), and String\regexp_match().

Referenced by getAddressArrayString(), Submission\getAuthorEmails(), getFromString(), and getReplyToString().

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

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

Parameters
$includeNamesboolean
Returns
string;

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

References encodeDisplayName(), and Core\isWindows().

Referenced by getBccString(), getCcString(), getRecipientString(), and send().

& Mail::getAttachments ( )

Get the attachments currently on the message.

Returns
array

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

References DataObject\getData().

Referenced by hasAttachments(), and send().

Mail::getBccs ( )

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

Returns
array

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

References DataObject\getData().

Referenced by PKPMailTemplate\displayEditForm(), getBccString(), MailTemplate\MailTemplate(), and send().

Mail::getBccString ( )

Return a string containing the Bcc recipients.

Returns
string

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

References getAddressArrayString(), and getBccs().

Referenced by ArticleMailTemplate\log().

Mail::getCcs ( )

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

Returns
array

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

References DataObject\getData().

Referenced by PKPMailTemplate\displayEditForm(), getCcString(), MailTemplate\MailTemplate(), promoteCcsIfNoRecipients(), and send().

Mail::getCcString ( )

Return a string containing the Cc recipients.

Returns
string

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

References getAddressArrayString(), and getCcs().

Referenced by ArticleMailTemplate\log().

Mail::getContentType ( )

Get the message content type (MIME)

Returns
string

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

References DataObject\getData().

Referenced by send().

Mail::getEnvelopeSender ( )

Get the envelope sender (bounce address) for the message, if set. Override any set envelope sender if force_default_envelope_sender config option is in effect.

Returns
string

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

References DataObject\getData(), and Config\getVar().

Referenced by send().

Mail::getFrom ( )

Get the sender of the message.

Returns
array

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

References DataObject\getData().

Referenced by getFromString().

Mail::getFromString (   $send = false)

Return a string containing the from address. Override any from address if force_default_envelope_sender config option is in effect.

Returns
string

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

References encodeDisplayName(), getFrom(), and Config\getVar().

Referenced by PKPMailTemplate\displayEditForm(), ArticleMailTemplate\log(), and send().

Mail::getHeaders ( )

Get the SMTP headers for the message.

Returns
array

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

References DataObject\getData().

Referenced by send(), and PKPMailTemplate\sendWithParams().

Mail::getRecipients ( )

Get the recipients for the message.

Returns
array

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

References DataObject\getData().

Referenced by PKPMailTemplate\displayEditForm(), getRecipientString(), MailTemplate\MailTemplate(), promoteCcsIfNoRecipients(), MassMail\send(), and send().

Mail::getRecipientString ( )

Return a string containing the recipients.

Returns
string

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

References getAddressArrayString(), and getRecipients().

Referenced by ArticleMailTemplate\log().

Mail::getReplyTo ( )

Get the reply-to of the message.

Returns
array

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

References DataObject\getData().

Referenced by getReplyToString().

Mail::getReplyToString (   $send = false)

Return a string containing the reply-to address.

Returns
string

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

References encodeDisplayName(), and getReplyTo().

Referenced by send().

Mail::hasAttachments ( )

Return true iff attachments are included in this message.

Returns
boolean

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

References getAttachments().

Referenced by send().

Mail::Mail ( )

Constructor.

Definition at line 31 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 189 of file Mail.inc.php.

References getCcs(), getRecipients(), setCcs(), and setRecipients().

Mail::setBccs (   $bccs)

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

Parameters
$bccsarray

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

References DataObject\setData().

Referenced by clearAllRecipients(), and MailTemplate\MailTemplate().

Mail::setBody (   $body)
Mail::setCcs (   $ccs)

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

Parameters
$ccsarray

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

References DataObject\setData().

Referenced by clearAllRecipients(), MailTemplate\MailTemplate(), and promoteCcsIfNoRecipients().

Mail::setContentType (   $contentType)

Set the message content type (MIME)

Parameters
$contentTypestring

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

References DataObject\setData().

Mail::setEnvelopeSender (   $envelopeSender)

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

Parameters
$envelopeSenderstring Email address

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

References DataObject\setData().

Referenced by Mail(), and MailTemplate\send().

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

Set the sender of the message.

Parameters
$emailstring
$namestring optional

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

References DataObject\setData().

Referenced by MailTemplate\MailTemplate().

Mail::setHeaders ( $headers)

Set the SMTP headers for the message.

Parameters
$headersarray

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

References DataObject\setData().

Referenced by PKPMailTemplate\sendWithParams().

Mail::setPrivateParams (   $privateParams)

Set the entire list of private parameters.

See Also
addPrivateParam

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

Mail::setRecipients (   $recipients)

Set the recipients for the message.

Parameters
$recipientsarray

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

References DataObject\setData().

Referenced by clearAllRecipients(), MailTemplate\MailTemplate(), 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 337 of file Mail.inc.php.

References DataObject\setData().

Referenced by MailTemplate\MailTemplate().

Mail::setSubject (   $subject)

Set the subject of the message.

Parameters
$subjectstring

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

References DataObject\setData().

Referenced by PKPMailTemplate\assignParams(), MailTemplate\MailTemplate(), MassMail\send(), ArticleMailTemplate\sendWithParams(), and PKPMailTemplate\sendWithParams().


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