Open Journal Systems  2.4.4
 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 ()
 
 getSubject ()
 
 hasAttachments ()
 
 Mail ()
 
 promoteCcsIfNoRecipients ()
 
 send ()
 
 setBccs ($bccs)
 
 setBody ($body)
 
 setCcs ($ccs)
 
 setContentType ($contentType)
 
 setEnvelopeSender ($envelopeSender)
 
 setFrom ($email, $name= '')
 
 setHeaders (&$headers)
 
 setPrivateParams ($privateParams)
 
 setRecipients ($recipients)
 
 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 253 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 154 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 124 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 209 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 198 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
Returns
string

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

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

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

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

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

Parameters
$includeNamesboolean
Returns
string;

Definition at line 377 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 296 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 167 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 421 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 137 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 413 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 91 of file Mail.inc.php.

References DataObject\getData().

Referenced by send().

Mail::getEnvelopeSender ( )

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

Returns
string

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

References DataObject\getData().

Referenced by send().

Mail::getFrom ( )

Get the sender of the message.

Returns
array

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

References DataObject\getData().

Referenced by getFromString().

Mail::getFromString (   $send = false)

Return a string containing the from address.

Returns
string

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

References encodeDisplayName(), and getFrom().

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

Mail::getHeaders ( )

Get the SMTP headers for the message.

Returns
array

Definition at line 234 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 107 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 405 of file Mail.inc.php.

References getAddressArrayString(), and getRecipients().

Referenced by ArticleMailTemplate\log().

Mail::hasAttachments ( )

Return true iff attachments are included in this message.

Returns
boolean

Definition at line 305 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 184 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 175 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 145 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 99 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 315 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 242 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 115 of file Mail.inc.php.

References DataObject\setData().

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

Mail::setSubject (   $subject)

Set the subject of the message.

Parameters
$subjectstring

Definition at line 331 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: