class MimeMailPHPMailer in PHPMailer 5
Same name and namespace in other branches
- 6 includes/mimemail.inc \MimeMailPHPMailer
Hierarchy
- class \PHPMailer
- class \MimeMailPHPMailer
Expanded class hierarchy of MimeMailPHPMailer
File
- includes/
mimemail.inc, line 5
View source
class MimeMailPHPMailer extends PHPMailer {
/**
* Constructor.
*/
function MimeMailPHPMailer() {
$this
->IsSMTP();
// Assemble host name(s).
$protocol = variable_get('smtp_protocol', '');
$this->Host = $protocol . variable_get('smtp_host', '');
if ($backup = variable_get('smtp_hostbackup', '')) {
$this->Host .= ';' . $protocol . $backup;
}
$this->Port = variable_get('smtp_port', '25');
// Use SMTP authentication if both username and password are given.
$this->Username = variable_get('smtp_username', '');
$this->Password = variable_get('smtp_password', '');
$this->SMTPAuth = $this->Username != '' && $this->Password != '';
// Set default From name.
$from_name = variable_get('smtp_fromname', '');
if ($from_name == '') {
// Fall back on site name.
$from_name = variable_get('site_name', 'Drupal');
}
$this->FromName = $from_name;
$this->SMTPKeepAlive = variable_get('smtp_keepalive', 0);
$this->SMTPDebug = variable_get('smtp_debug', 0);
$this->CharSet = variable_get('smtp_charset', 'utf-8');
// Adjust path to SMTP class.
$this->PluginDir = drupal_get_path('module', 'phpmailer') . '/phpmailer/';
}
/**
* Sets the language for all class error messages.
*/
function SetLanguage($lang_type, $lang_path = null) {
$PHPMAILER_LANG = array();
$PHPMAILER_LANG["provide_address"] = t('You must provide at least one recipient email address.');
$PHPMAILER_LANG["mailer_not_supported"] = t(' mailer is not supported.');
$PHPMAILER_LANG["execute"] = t('Could not execute: ');
$PHPMAILER_LANG["instantiate"] = t('Could not instantiate mail function.');
$PHPMAILER_LANG["authenticate"] = t('SMTP Error: Could not authenticate.');
$PHPMAILER_LANG["from_failed"] = t('The following From address failed: ');
$PHPMAILER_LANG["recipients_failed"] = t('SMTP Error: The following recipients failed: ');
$PHPMAILER_LANG["data_not_accepted"] = t('SMTP Error: Data not accepted.');
$PHPMAILER_LANG["connect_host"] = t('SMTP Error: Could not connect to SMTP host.');
$PHPMAILER_LANG["file_access"] = t('Could not access file: ');
$PHPMAILER_LANG["file_open"] = t('File Error: Could not open file: ');
$PHPMAILER_LANG["encoding"] = t('Unknown encoding: ');
$this->language = $PHPMAILER_LANG;
return true;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
MimeMailPHPMailer:: |
function | Constructor. | ||
MimeMailPHPMailer:: |
function |
Sets the language for all class error messages. Overrides PHPMailer:: |
||
PHPMailer:: |
property | Sets the text-only body of the message. This automatically sets the email to multipart/alternative. This body can be read by mail clients that do not have HTML email capability such as mutt. Clients that can read HTML will view the normal Body. | ||
PHPMailer:: |
property | |||
PHPMailer:: |
property | |||
PHPMailer:: |
property | Sets the Body of the message. This can be either an HTML or text body. If HTML then run IsHTML(true). | ||
PHPMailer:: |
property | |||
PHPMailer:: |
property | |||
PHPMailer:: |
property | Sets the CharSet of the message. | ||
PHPMailer:: |
property | Sets the email address that a reading confirmation will be sent. | ||
PHPMailer:: |
property | Sets the Content-type of the message. | ||
PHPMailer:: |
property | |||
PHPMailer:: |
property | Sets the Encoding of the message. Options for this are "8bit", "7bit", "binary", "base64", and "quoted-printable". | ||
PHPMailer:: |
property | Holds the most recent mailer error message. | ||
PHPMailer:: |
property | |||
PHPMailer:: |
property | Sets the From email address for the message. | ||
PHPMailer:: |
property | Sets the From name of the message. | ||
PHPMailer:: |
property | Sets the SMTP HELO of the message (Default is $Hostname). | ||
PHPMailer:: |
property | Sets the SMTP hosts. All hosts must be separated by a semicolon. You can also specify a different port for each host by using this format: [hostname:port] (e.g. "smtp1.example.com:25;smtp2.example.com"). Hosts will be tried in order. | ||
PHPMailer:: |
property | Sets the hostname to use in Message-Id and Received headers and as default HELO string. If empty, the value returned by SERVER_NAME is used or 'localhost.localdomain'. | ||
PHPMailer:: |
property | |||
PHPMailer:: |
property | |||
PHPMailer:: |
property | Method to send mail: ("mail", "sendmail", or "smtp"). | ||
PHPMailer:: |
property | |||
PHPMailer:: |
property | Sets SMTP password. | ||
PHPMailer:: |
property | Path to PHPMailer plugins. This is now only useful if the SMTP class is in a different directory than the PHP include path. | ||
PHPMailer:: |
property | Sets the default SMTP server port. | ||
PHPMailer:: |
property | Email priority (1 = High, 3 = Normal, 5 = low). | ||
PHPMailer:: |
property | |||
PHPMailer:: |
property | |||
PHPMailer:: |
property | Sets the Sender email (Return-Path) of the message. If not empty, will be sent via -f to sendmail or as 'MAIL FROM' in smtp mode. | ||
PHPMailer:: |
property | Sets the path of the sendmail program. | ||
PHPMailer:: |
property | |||
PHPMailer:: |
property | Sets SMTP authentication. Utilizes the Username and Password variables. | ||
PHPMailer:: |
property | Sets SMTP class debugging on or off. | ||
PHPMailer:: |
property | Prevents the SMTP connection from being closed after each mail sending. If this is set to true then to close the connection requires an explicit call to SmtpClose(). | ||
PHPMailer:: |
property | Sets the Subject of the message. | ||
PHPMailer:: |
property | Sets the SMTP server timeout in seconds. This function will not work with the win32 version. | ||
PHPMailer:: |
property | |||
PHPMailer:: |
property | Sets SMTP username. | ||
PHPMailer:: |
property | Holds PHPMailer version. | ||
PHPMailer:: |
property | Sets word wrapping on the body of the message to a given number of characters. | ||
PHPMailer:: |
function | Adds a "To" address. | ||
PHPMailer:: |
function | Adds an attachment from a path on the filesystem. Returns false if the file could not be found or accessed. | ||
PHPMailer:: |
function | Adds a "Bcc" address. Note: this function works with the SMTP mailer on win32, not with the "mail" mailer. | ||
PHPMailer:: |
function | Adds a "Cc" address. Note: this function works with the SMTP mailer on win32, not with the "mail" mailer. | ||
PHPMailer:: |
function | Adds a custom header. | ||
PHPMailer:: |
function | Adds an embedded attachment. This can include images, sounds, and just about any other document. Make sure to set the $type to an image type. For JPEG images use "image/jpeg" and for GIF images use "image/gif". | ||
PHPMailer:: |
function | Creates recipient headers. @access private | ||
PHPMailer:: |
function | Adds a "Reply-to" address. | ||
PHPMailer:: |
function | Formats an address correctly. @access private | ||
PHPMailer:: |
function | Adds a string or binary attachment (non-filesystem) to the list. This method can be used to attach ascii or binary data, such as a BLOB record from a database. | ||
PHPMailer:: |
function | Attaches all fs, string, and binary attachments to the message. Returns an empty string on failure. @access private | ||
PHPMailer:: |
function | Clears all recipients assigned in the TO array. Returns void. | ||
PHPMailer:: |
function | Clears all recipients assigned in the TO, CC and BCC array. Returns void. | ||
PHPMailer:: |
function | Clears all previously set filesystem, string, and binary attachments. Returns void. | ||
PHPMailer:: |
function | Clears all recipients assigned in the BCC array. Returns void. | ||
PHPMailer:: |
function | Clears all recipients assigned in the CC array. Returns void. | ||
PHPMailer:: |
function | Clears all custom headers. Returns void. | ||
PHPMailer:: |
function | Clears all recipients assigned in the ReplyTo array. Returns void. | ||
PHPMailer:: |
function | Assembles the message body. Returns an empty string on failure. @access private | ||
PHPMailer:: |
function | Assembles message header. @access private | ||
PHPMailer:: |
function | Encodes attachment in requested format. Returns an empty string on failure. @access private | ||
PHPMailer:: |
function | Encode a header string to best of Q, B, quoted or none. @access private | ||
PHPMailer:: |
function | Encode string to q encoding. @access private | ||
PHPMailer:: |
function | Encode string to quoted-printable. @access private | ||
PHPMailer:: |
function | Encodes string to requested format. Returns an empty string on failure. @access private | ||
PHPMailer:: |
function | Returns the end of a message boundary. @access private | ||
PHPMailer:: |
function | Changes every end of line from CR or LF to CRLF. @access private | ||
PHPMailer:: |
function | Returns the start of a message boundary. @access private | ||
PHPMailer:: |
function | Returns a formatted header line. @access private | ||
PHPMailer:: |
function | Returns true if an inline attachment is present. @access private | ||
PHPMailer:: |
function | Returns true if an error occurred. | ||
PHPMailer:: |
function | Sets message type to HTML. | ||
PHPMailer:: |
function | Sets Mailer to send message using PHP mail() function. | ||
PHPMailer:: |
function | Sets Mailer to send message using the qmail MTA. | ||
PHPMailer:: |
function | Sets Mailer to send message using the $Sendmail program. | ||
PHPMailer:: |
function | Sets Mailer to send message using SMTP. | ||
PHPMailer:: |
function | Returns a message in the appropriate language. @access private | ||
PHPMailer:: |
function | Sends mail using the PHP mail() function. @access private | ||
PHPMailer:: |
function | Returns the proper RFC 822 formatted date. @access private | ||
PHPMailer:: |
function | Creates message and assigns Mailer. If the message is not sent successfully then it returns false. Use the ErrorInfo variable to view description of the error. | ||
PHPMailer:: |
function | Sends mail using the $Sendmail program. @access private | ||
PHPMailer:: |
function | Returns the server hostname or 'localhost.localdomain' if unknown. @access private | ||
PHPMailer:: |
function | Returns the appropriate server variable. Should work with both PHP 4.1.0+ as well as older versions. Returns an empty string if nothing is found. @access private | ||
PHPMailer:: |
function | Adds the error message to the error container. Returns void. @access private | ||
PHPMailer:: |
function | Sets the message type. @access private | ||
PHPMailer:: |
function | Set the body wrapping. @access private | ||
PHPMailer:: |
function | Closes the active SMTP session if one exists. | ||
PHPMailer:: |
function | Initiates a connection to an SMTP server. Returns false if the operation failed. @access private | ||
PHPMailer:: |
function | Sends mail via SMTP using PhpSMTP (Author: Chris Ryan). Returns bool. Returns false if there is a bad MAIL FROM, RCPT, or DATA input. @access private | ||
PHPMailer:: |
function | Returns a formatted mail line. @access private | ||
PHPMailer:: |
function | Wraps message for use with mailers that do not automatically perform wrapping and for quoted-printable. Original written by philippe. @access private |