[ Index ] |
WordPress Cross Reference |
[Source view] [Print] [Project Stats]
PHPMailer - PHP email creation and transport class NOTE: Requires PHP version 5 or later
Author: | Andy Prevost |
Author: | Marcus Bointon |
Author: | Jim Jagielski |
Copyright: | 2010 - 2012 Jim Jagielski |
Copyright: | 2004 - 2009 Andy Prevost |
License: | http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License |
File Size: | 2826 lines (91 kb) |
Included or required: | 1 time |
Referenced: | 0 times |
Includes or requires: | 0 files |
PHPMailer:: (81 methods):
mail_passthru()
edebug()
__construct()
IsHTML()
IsSMTP()
IsMail()
IsSendmail()
IsQmail()
AddAddress()
AddCC()
AddBCC()
AddReplyTo()
AddAnAddress()
SetFrom()
ValidateAddress()
Send()
PreSend()
PostSend()
SendmailSend()
MailSend()
SmtpSend()
SmtpConnect()
SmtpClose()
SetLanguage()
GetTranslations()
AddrAppend()
AddrFormat()
WrapText()
UTF8CharBoundary()
SetWordWrap()
CreateHeader()
GetMailMIME()
GetSentMIMEMessage()
CreateBody()
GetBoundary()
EndBoundary()
SetMessageType()
HeaderLine()
TextLine()
AddAttachment()
GetAttachments()
AttachAll()
EncodeFile()
EncodeString()
EncodeHeader()
HasMultiBytes()
Base64EncodeWrapMB()
EncodeQPphp()
EncodeQP()
EncodeQ()
AddStringAttachment()
AddEmbeddedImage()
AddStringEmbeddedImage()
InlineImageExists()
AttachmentExists()
AlternativeExists()
ClearAddresses()
ClearCCs()
ClearBCCs()
ClearReplyTos()
ClearAllRecipients()
ClearAttachments()
ClearCustomHeaders()
SetError()
RFCDate()
ServerHostname()
Lang()
IsError()
FixEOL()
AddCustomHeader()
MsgHTML()
_mime_types()
set()
SecureHeader()
Sign()
DKIM_QP()
DKIM_Sign()
DKIM_HeaderC()
DKIM_BodyC()
DKIM_Add()
doCallback()
phpmailerException:: (1 method):
errorMessage()
mail_passthru($to, $subject, $body, $header, $params) X-Ref |
Calls actual mail() function, but in a safe_mode aware fashion Also, unless sendmail_path points to sendmail (or something that claims to be sendmail), don't pass params (not a perfect fix, but it will do) param: string $to To param: string $subject Subject param: string $body Message Body param: string $header Additional Header(s) param: string $params Params return: bool |
edebug($str) X-Ref |
Outputs debugging info via user-defined method param: string $str |
__construct($exceptions = false) X-Ref |
Constructor param: boolean $exceptions Should we throw external exceptions? |
IsHTML($ishtml = true) X-Ref |
Sets message type to HTML. param: bool $ishtml return: void |
IsSMTP() X-Ref |
Sets Mailer to send message using SMTP. return: void |
IsMail() X-Ref |
Sets Mailer to send message using PHP mail() function. return: void |
IsSendmail() X-Ref |
Sets Mailer to send message using the $Sendmail program. return: void |
IsQmail() X-Ref |
Sets Mailer to send message using the qmail MTA. return: void |
AddAddress($address, $name = '') X-Ref |
Adds a "To" address. param: string $address param: string $name return: boolean true on success, false if address already used |
AddCC($address, $name = '') X-Ref |
Adds a "Cc" address. Note: this function works with the SMTP mailer on win32, not with the "mail" mailer. param: string $address param: string $name return: boolean true on success, false if address already used |
AddBCC($address, $name = '') X-Ref |
Adds a "Bcc" address. Note: this function works with the SMTP mailer on win32, not with the "mail" mailer. param: string $address param: string $name return: boolean true on success, false if address already used |
AddReplyTo($address, $name = '') X-Ref |
Adds a "Reply-to" address. param: string $address param: string $name return: boolean |
AddAnAddress($kind, $address, $name = '') X-Ref |
Adds an address to one of the recipient arrays Addresses that have been added already return false, but do not throw exceptions param: string $kind One of 'to', 'cc', 'bcc', 'ReplyTo' param: string $address The email address to send to param: string $name return: boolean true on success, false if address already used or invalid in some way |
SetFrom($address, $name = '', $auto = 1) X-Ref |
Set the From and FromName properties param: string $address param: string $name param: int $auto Also set Reply-To and Sender return: boolean |
ValidateAddress($address) X-Ref |
Check that a string looks roughly like an email address should Static so it can be used without instantiation, public so people can overload Conforms to RFC5322: Uses *correct* regex on which FILTER_VALIDATE_EMAIL is based; So why not use FILTER_VALIDATE_EMAIL? Because it was broken to not allow a@b type valid addresses :( Some Versions of PHP break on the regex though, likely due to PCRE, so use the older validation method for those users. (http://php.net/manual/en/pcre.installation.php) param: string $address The email address to check return: boolean |
Send() X-Ref |
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. return: bool |
PreSend() X-Ref |
Prep mail by constructing all message entities return: bool |
PostSend() X-Ref |
Actual Email transport function Send the email via the selected mechanism return: bool |
SendmailSend($header, $body) X-Ref |
Sends mail using the $Sendmail program. param: string $header The message headers param: string $body The message body return: bool |
MailSend($header, $body) X-Ref |
Sends mail using the PHP mail() function. param: string $header The message headers param: string $body The message body return: bool |
SmtpSend($header, $body) X-Ref |
Sends mail via SMTP using PhpSMTP Returns false if there is a bad MAIL FROM, RCPT, or DATA input. param: string $header The message headers param: string $body The message body return: bool |
SmtpConnect() X-Ref |
Initiates a connection to an SMTP server. Returns false if the operation failed. return: bool |
SmtpClose() X-Ref |
Closes the active SMTP session if one exists. return: void |
SetLanguage($langcode = 'en', $lang_path = 'language/') X-Ref |
Sets the language for all class error messages. Returns false if it cannot load the language file. The default language is English. param: string $langcode ISO 639-1 2-character language code (e.g. Portuguese: "br") param: string $lang_path Path to the language file directory return: bool |
GetTranslations() X-Ref |
Return the current array of language strings return: array |
AddrAppend($type, $addr) X-Ref |
Creates recipient headers. param: string $type param: array $addr return: string |
AddrFormat($addr) X-Ref |
Formats an address correctly. param: string $addr return: string |
WrapText($message, $length, $qp_mode = false) X-Ref |
Wraps message for use with mailers that do not automatically perform wrapping and for quoted-printable. Original written by philippe. param: string $message The message to wrap param: integer $length The line length to wrap to param: boolean $qp_mode Whether to run in Quoted-Printable mode return: string |
UTF8CharBoundary($encodedText, $maxLength) X-Ref |
Finds last character boundary prior to maxLength in a utf-8 quoted (printable) encoded string. Original written by Colin Brown. param: string $encodedText utf-8 QP text param: int $maxLength find last character boundary prior to this length return: int |
SetWordWrap() X-Ref |
Set the body wrapping. return: void |
CreateHeader() X-Ref |
Assembles message header. return: string The assembled header |
GetMailMIME() X-Ref |
Returns the message MIME. return: string |
GetSentMIMEMessage() X-Ref |
Returns the MIME message (headers and body). Only really valid post PreSend(). return: string |
CreateBody() X-Ref |
Assembles the message body. Returns an empty string on failure. return: string The assembled message body |
GetBoundary($boundary, $charSet, $contentType, $encoding) X-Ref |
Returns the start of a message boundary. param: string $boundary param: string $charSet param: string $contentType param: string $encoding return: string |
EndBoundary($boundary) X-Ref |
Returns the end of a message boundary. param: string $boundary return: string |
SetMessageType() X-Ref |
Sets the message type. return: void |
HeaderLine($name, $value) X-Ref |
Returns a formatted header line. param: string $name param: string $value return: string |
TextLine($value) X-Ref |
Returns a formatted mail line. param: string $value return: string |
AddAttachment($path, $name = '', $encoding = 'base64', $type = 'application/octet-stream') X-Ref |
Adds an attachment from a path on the filesystem. Returns false if the file could not be found or accessed. param: string $path Path to the attachment. param: string $name Overrides the attachment name. param: string $encoding File encoding (see $Encoding). param: string $type File extension (MIME) type. return: bool |
GetAttachments() X-Ref |
Return the current array of attachments return: array |
AttachAll($disposition_type, $boundary) X-Ref |
Attaches all fs, string, and binary attachments to the message. Returns an empty string on failure. param: string $disposition_type param: string $boundary return: string |
EncodeFile($path, $encoding = 'base64') X-Ref |
Encodes attachment in requested format. Returns an empty string on failure. param: string $path The full path to the file param: string $encoding The encoding to use; one of 'base64', '7bit', '8bit', 'binary', 'quoted-printable' return: string |
EncodeString($str, $encoding = 'base64') X-Ref |
Encodes string to requested format. Returns an empty string on failure. param: string $str The text to encode param: string $encoding The encoding to use; one of 'base64', '7bit', '8bit', 'binary', 'quoted-printable' return: string |
EncodeHeader($str, $position = 'text') X-Ref |
Encode a header string to best (shortest) of Q, B, quoted or none. param: string $str param: string $position return: string |
HasMultiBytes($str) X-Ref |
Checks if a string contains multibyte characters. param: string $str multi-byte text to wrap encode return: bool |
Base64EncodeWrapMB($str, $lf=null) X-Ref |
Correctly encodes and wraps long multibyte strings for mail headers without breaking lines within a character. Adapted from a function by paravoid at http://uk.php.net/manual/en/function.mb-encode-mimeheader.php param: string $str multi-byte text to wrap encode param: string $lf string to use as linefeed/end-of-line return: string |
EncodeQPphp( $input = '', $line_max = 76, $space_conv = false) X-Ref |
Encode string to quoted-printable. Only uses standard PHP, slow, but will always work param: string $input param: integer $line_max Number of chars allowed on a line before wrapping param: bool $space_conv return: string |
EncodeQP($string, $line_max = 76, $space_conv = false) X-Ref |
Encode string to RFC2045 (6.7) quoted-printable format Uses a PHP5 stream filter to do the encoding about 64x faster than the old version Also results in same content as you started with after decoding author: Marcus Bointon param: string $string the text to encode param: integer $line_max Number of chars allowed on a line before wrapping param: boolean $space_conv Dummy param for compatibility with existing EncodeQP function return: string |
EncodeQ($str, $position = 'text') X-Ref |
Encode string to q encoding. param: string $str the text to encode param: string $position Where the text is going to be used, see the RFC for what that means return: string |
AddStringAttachment($string, $filename, $encoding = 'base64', $type = 'application/octet-stream') X-Ref |
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. param: string $string String attachment data. param: string $filename Name of the attachment. param: string $encoding File encoding (see $Encoding). param: string $type File extension (MIME) type. return: void |
AddEmbeddedImage($path, $cid, $name = '', $encoding = 'base64', $type = 'application/octet-stream') X-Ref |
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". param: string $path Path to the attachment. param: string $cid Content ID of the attachment. Use this to identify param: string $name Overrides the attachment name. param: string $encoding File encoding (see $Encoding). param: string $type File extension (MIME) type. return: bool |
AddStringEmbeddedImage($string, $cid, $name = '', $encoding = 'base64', $type = 'application/octet-stream') X-Ref |
Adds an embedded stringified 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". param: string $string The attachment. param: string $cid Content ID of the attachment. Use this to identify param: string $name Overrides the attachment name. param: string $encoding File encoding (see $Encoding). param: string $type File extension (MIME) type. return: bool |
InlineImageExists() X-Ref |
Returns true if an inline attachment is present. return: bool |
AttachmentExists() X-Ref |
Returns true if an attachment (non-inline) is present. return: bool |
AlternativeExists() X-Ref |
Does this message have an alternative body set? return: bool |
ClearAddresses() X-Ref |
Clears all recipients assigned in the TO array. Returns void. return: void |
ClearCCs() X-Ref |
Clears all recipients assigned in the CC array. Returns void. return: void |
ClearBCCs() X-Ref |
Clears all recipients assigned in the BCC array. Returns void. return: void |
ClearReplyTos() X-Ref |
Clears all recipients assigned in the ReplyTo array. Returns void. return: void |
ClearAllRecipients() X-Ref |
Clears all recipients assigned in the TO, CC and BCC array. Returns void. return: void |
ClearAttachments() X-Ref |
Clears all previously set filesystem, string, and binary attachments. Returns void. return: void |
ClearCustomHeaders() X-Ref |
Clears all custom headers. Returns void. return: void |
SetError($msg) X-Ref |
Adds the error message to the error container. param: string $msg return: void |
RFCDate() X-Ref |
Returns the proper RFC 822 formatted date. return: string |
ServerHostname() X-Ref |
Returns the server hostname or 'localhost.localdomain' if unknown. return: string |
Lang($key) X-Ref |
Returns a message in the appropriate language. param: string $key return: string |
IsError() X-Ref |
Returns true if an error occurred. return: bool |
FixEOL($str) X-Ref |
Changes every end of line from CRLF, CR or LF to $this->LE. param: string $str String to FixEOL return: string |
AddCustomHeader($name, $value=null) X-Ref |
Adds a custom header. $name value can be overloaded to contain both header name and value (name:value) param: string $name custom header name param: string $value header value return: void |
MsgHTML($message, $basedir = '') X-Ref |
Evaluates the message and returns modifications for inline images and backgrounds param: string $message Text to be HTML modified param: string $basedir baseline directory for path return: string $message |
_mime_types($ext = '') X-Ref |
Gets the MIME type of the embedded or inline image param: string $ext File extension return: string MIME type of ext |
set($name, $value = '') X-Ref |
Set (or reset) Class Objects (variables) Usage Example: $page->set('X-Priority', '3'); param: string $name Parameter Name param: mixed $value Parameter Value return: bool |
SecureHeader($str) X-Ref |
Strips newlines to prevent header injection. param: string $str String return: string |
Sign($cert_filename, $key_filename, $key_pass) X-Ref |
Set the private key file and password to sign the message. param: $cert_filename param: string $key_filename Parameter File Name param: string $key_pass Password for private key |
DKIM_QP($txt) X-Ref |
Set the private key file and password to sign the message. param: string $txt return: string |
DKIM_Sign($s) X-Ref |
Generate DKIM signature param: string $s Header return: string |
DKIM_HeaderC($s) X-Ref |
Generate DKIM Canonicalization Header param: string $s Header return: string |
DKIM_BodyC($body) X-Ref |
Generate DKIM Canonicalization Body param: string $body Message Body return: string |
DKIM_Add($headers_line, $subject, $body) X-Ref |
Create the DKIM header, body, as new header param: string $headers_line Header lines param: string $subject Subject param: string $body Body return: string |
doCallback($isSent, $to, $cc, $bcc, $subject, $body, $from=null) X-Ref |
Perform callback param: boolean $isSent param: string $to param: string $cc param: string $bcc param: string $subject param: string $body param: string $from |
Class: phpmailerException - X-Ref
Exception handler for PHPMailererrorMessage() X-Ref |
Prettify error message output return: string |
Generated: Tue Mar 25 01:41:18 2014 | WordPress honlapkészítés: online1.hu |