STOP_MESSAGE
STOP_MESSAGE = 0
ValidateAddress(string $address) : boolean
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
string | $address | The email address to check |
SetLanguage(string $langcode = 'en', string $lang_path = 'language/')
Sets the language for all class error messages.
Returns false if it cannot load the language file. The default language is English.
string | $langcode | ISO 639-1 2-character language code (e.g. Portuguese: "br") |
string | $lang_path | Path to the language file directory |
WrapText(string $message, integer $length, boolean $qp_mode = false) : string
Wraps message for use with mailers that do not automatically perform wrapping and for quoted-printable.
Original written by philippe.
string | $message | The message to wrap |
integer | $length | The line length to wrap to |
boolean | $qp_mode | Whether to run in Quoted-Printable mode |
UTF8CharBoundary(string $encodedText, integer $maxLength) : integer
Finds last character boundary prior to maxLength in a utf-8 quoted (printable) encoded string.
Original written by Colin Brown.
string | $encodedText | utf-8 QP text |
integer | $maxLength | find last character boundary prior to this length |
AddAttachment(string $path, string $name = '', string $encoding = 'base64', string $type = 'application/octet-stream') : boolean
Adds an attachment from a path on the filesystem.
Returns false if the file could not be found or accessed.
string | $path | Path to the attachment. |
string | $name | Overrides the attachment name. |
string | $encoding | File encoding (see $Encoding). |
string | $type | File extension (MIME) type. |
EncodeString(string $str, string $encoding = 'base64') : string
Encodes string to requested format.
Returns an empty string on failure.
string | $str | The text to encode |
string | $encoding | The encoding to use; one of 'base64', '7bit', '8bit', 'binary', 'quoted-printable' |
Base64EncodeWrapMB(string $str) : string
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
string | $str | multi-byte text to wrap encode |
EncodeQP(string $string, integer $line_max = 76, boolean $space_conv = false) : string
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
string | $string | the text to encode |
integer | $line_max | Number of chars allowed on a line before wrapping |
boolean | $space_conv | Dummy param for compatibility with existing EncodeQP function |
AddStringAttachment(string $string, string $filename, string $encoding = 'base64', string $type = 'application/octet-stream') : void
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.
string | $string | String attachment data. |
string | $filename | Name of the attachment. |
string | $encoding | File encoding (see $Encoding). |
string | $type | File extension (MIME) type. |
AddEmbeddedImage(string $path, string $cid, string $name = '', string $encoding = 'base64', string $type = 'application/octet-stream') : boolean
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".
string | $path | Path to the attachment. |
string | $cid | Content ID of the attachment. Use this to identify the Id for accessing the image in an HTML form. |
string | $name | Overrides the attachment name. |
string | $encoding | File encoding (see $Encoding). |
string | $type | File extension (MIME) type. |
AddAnAddress(string $kind, string $address, string $name = '') : boolean
Adds an address to one of the recipient arrays Addresses that have been added already return false, but do not throw exceptions
string | $kind | One of 'to', 'cc', 'bcc', 'ReplyTo' |
string | $address | The email address to send to |
string | $name |
true on success, false if address already used or invalid in some way
EncodeFile(string $path, string $encoding = 'base64') : string
Encodes attachment in requested format.
Returns an empty string on failure.
string | $path | The full path to the file |
string | $encoding | The encoding to use; one of 'base64', '7bit', '8bit', 'binary', 'quoted-printable' |