[ Index ]

PHP Cross Reference of BackPress

title

Body

[close]

/includes/ -> class.mailer.php (summary)

PHPMailer - PHP email 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
Version: $Id: class.phpmailer.php 450 2010-06-23 16:46:33Z coolbru $
File Size: 2549 lines (82 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 2 classes

PHPMailer:: (80 methods):
  __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()
  get_magic_quotes()
  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()


Class: PHPMailer  - X-Ref

__construct($exceptions = false)   X-Ref
Constructor

param: boolean $exceptions Should we throw external exceptions?

IsHTML($ishtml = true)   X-Ref
Sets message type to HTML.

return: void
param: bool $ishtml

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.

return: boolean true on success, false if address already used
param: string $address
param: string $name

AddCC($address, $name = '')   X-Ref
Adds a "Cc" address.
Note: this function works with the SMTP mailer on win32, not with the "mail" mailer.

return: boolean true on success, false if address already used
param: string $address
param: string $name

AddBCC($address, $name = '')   X-Ref
Adds a "Bcc" address.
Note: this function works with the SMTP mailer on win32, not with the "mail" mailer.

return: boolean true on success, false if address already used
param: string $address
param: string $name

AddReplyTo($address, $name = '')   X-Ref
Adds a "Reply-to" address.

return: boolean
param: string $address
param: string $name

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

return: boolean true on success, false if address already used or invalid in some way
param: string $kind One of 'to', 'cc', 'bcc', 'ReplyTo'
param: string $address The email address to send to
param: string $name

SetFrom($address, $name = '', $auto = 1)   X-Ref
Set the From and FromName properties

return: boolean
param: string $address
param: string $name

ValidateAddress($address)   X-Ref
Check that a string looks roughly like an email address should
Static so it can be used without instantiation
Tries to use PHP built-in validator in the filter extension (from PHP 5.2), falls back to a reasonably competent regex validator
Conforms approximately to RFC2822

return: boolean
param: string $address The email address to check

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
No description

PostSend()   X-Ref
No description

SendmailSend($header, $body)   X-Ref
Sends mail using the $Sendmail program.

return: bool
param: string $header The message headers
param: string $body The message body

MailSend($header, $body)   X-Ref
Sends mail using the PHP mail() function.

return: bool
param: string $header The message headers
param: string $body The message body

SmtpSend($header, $body)   X-Ref
Sends mail via SMTP using PhpSMTP
Returns false if there is a bad MAIL FROM, RCPT, or DATA input.

return: bool
param: string $header The message headers
param: string $body The message body

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

GetTranslations()   X-Ref
Return the current array of language strings

return: array

AddrAppend($type, $addr)   X-Ref
Creates recipient headers.

return: string

AddrFormat($addr)   X-Ref
Formats an address correctly.

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.

return: string
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

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.

return: int
param: string $encodedText utf-8 QP text
param: int    $maxLength   find last character boundary prior to this length

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.

return: string

EndBoundary($boundary)   X-Ref
Returns the end of a message boundary.

return: string

SetMessageType()   X-Ref
Sets the message type.

return: void

HeaderLine($name, $value)   X-Ref
Returns a formatted header line.

return: string

TextLine($value)   X-Ref
Returns a formatted mail line.

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.

return: bool
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.

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.

return: string

EncodeFile($path, $encoding = 'base64')   X-Ref
Encodes attachment in requested format.
Returns an empty string on failure.

return: string
param: string $path The full path to the file
param: string $encoding The encoding to use; one of 'base64', '7bit', '8bit', 'binary', 'quoted-printable'

get_magic_quotes()   X-Ref
No description

EncodeString($str, $encoding = 'base64')   X-Ref
Encodes string to requested format.
Returns an empty string on failure.

return: string
param: string $str The text to encode
param: string $encoding The encoding to use; one of 'base64', '7bit', '8bit', 'binary', 'quoted-printable'

EncodeHeader($str, $position = 'text')   X-Ref
Encode a header string to best (shortest) of Q, B, quoted or none.

return: string

HasMultiBytes($str)   X-Ref
Checks if a string contains multibyte characters.

return: bool
param: string $str multi-byte text to wrap encode

Base64EncodeWrapMB($str)   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

return: string
param: string $str multi-byte text to wrap encode

EncodeQPphp( $input = '', $line_max = 76, $space_conv = false)   X-Ref
Encode string to quoted-printable.
Only uses standard PHP, slow, but will always work

return: string
param: string $string the text to encode
param: integer $line_max Number of chars allowed on a line before wrapping

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

return: string
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

EncodeQ($str, $position = 'text')   X-Ref
Encode string to q encoding.

return: string
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

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.

return: void
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.

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".

return: bool
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.

AddStringEmbeddedImage($string, $cid, $filename = '', $encoding = 'base64', $type = 'application/octet-stream')   X-Ref
No description

InlineImageExists()   X-Ref
Returns true if an inline attachment is present.

return: bool

AttachmentExists()   X-Ref
No description

AlternativeExists()   X-Ref
No description

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.

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.

return: string

IsError()   X-Ref
Returns true if an error occurred.

return: bool

FixEOL($str)   X-Ref
Changes every end of line from CR or LF to CRLF.

return: string

AddCustomHeader($custom_header)   X-Ref
Adds a custom header.

return: void

MsgHTML($message, $basedir = '')   X-Ref
Evaluates the message and returns modifications for inline images and backgrounds

return: $message

_mime_types($ext = '')   X-Ref
Gets the MIME type of the embedded or inline image

return: string MIME type of ext
param: string File extension

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

SecureHeader($str)   X-Ref
Strips newlines to prevent header injection.

return: string
param: string $str String

Sign($cert_filename, $key_filename, $key_pass)   X-Ref
Set the private key file and password to sign the message.

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 $key_filename Parameter File Name
param: string $key_pass Password for private key

DKIM_Sign($s)   X-Ref
Generate DKIM signature

param: string $s Header

DKIM_HeaderC($s)   X-Ref
Generate DKIM Canonicalization Header

param: string $s Header

DKIM_BodyC($body)   X-Ref
Generate DKIM Canonicalization Body

param: string $body Message Body

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

doCallback($isSent, $to, $cc, $bcc, $subject, $body)   X-Ref
No description

Class: phpmailerException  - X-Ref

errorMessage()   X-Ref
No description



Generated: Sat Apr 27 01:00:53 2024 Cross-referenced by PHPXref 0.7.1