CRM_Utils_Mail
class CRM_Utils_Mail
Methods
Create a new mailer to send any mail from the application.
Create a new instance of a PEAR Mail driver.
Wrapper function to send mail in CiviCRM. Hooks are called from this function. The input parameter is an associateive array which holds the values of field needed to send an email. These are:
No description
No description
Get the email address itself from a formatted full name + address string
Get the Active outBound email.
No description
No description
Takes a string and checks to see if it needs to be escaped / double quoted and if so does the needful and return the formatted name
No description
Format an email string from email fields.
When passed a value, returns the value if it's non-numeric.
Details
at line 45
static Mail
createMailer()
Create a new mailer to send any mail from the application.
Note: The mailer is opened in persistent mode.
Note: You probably don't want to call this directly. Get a reference to the mailer through the container.
at line 134
static object
_createMailer(string $driver, array $params)
Create a new instance of a PEAR Mail driver.
at line 169
static bool
send(array $params)
Wrapper function to send mail in CiviCRM. Hooks are called from this function. The input parameter is an associateive array which holds the values of field needed to send an email. These are:
from : complete from envelope toName : name of person to send email toEmail : email address to send to cc : email addresses to cc bcc : email addresses to bcc subject : subject of the email text : text of the message html : html version of the message replyTo : reply-to header in the email attachments: an associative array of fullPath : complete pathname to the file mime_type: mime type of the attachment cleanName: the user friendly name of the attachmment
at line 320
static string
errorMessage($mailer, $result)
at line 344
static
logger($to, $headers, $message)
at line 384
static string
pluckEmailFromHeader(string $header)
Get the email address itself from a formatted full name + address string
Ugly but working.
at line 399
static bool
validOutBoundMail()
Get the Active outBound email.
at line 431
static mixed
setMimeParams($message, array $params = NULL)
at line 455
static null|string
formatRFC822Email(string $name, $email, bool $useQuote = FALSE)
at line 497
static string
formatRFC2822Name(string $name)
Takes a string and checks to see if it needs to be escaped / double quoted and if so does the needful and return the formatted name
This code has been copied and adapted from ezc/Mail/src/tools.php
at line 521
static array
appendPDF(string $fileName, string $html, string $format = NULL)
at line 550
static string
format(array $fields)
Format an email string from email fields.
at line 590
static string
formatFromAddress(string $from)
When passed a value, returns the value if it's non-numeric.
If it's numeric, look up the display name and email of the corresponding contact ID in RFC822 format.