Returns the proper RFC 822 formatted date.
API Tags:
static boolean ValidateAddress(
string
$address
)
|
|
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
Parameters:
|
string |
$address: |
The email address to check |
API Tags:
Information Tags:
static string _mime_types(
[string
$ext = '']
)
|
|
Gets the MIME type of the embedded or inline image
Parameters:
|
string |
$ext: |
File extension |
API Tags:
| Return: | MIME type of ext |
| Access: | public |
PHPMailer __construct(
[boolean
$exceptions = false]
)
|
|
Constructor
Parameters:
|
boolean |
$exceptions: |
Should we throw external exceptions? |
API Tags:
boolean AddAddress(
string
$address, [string
$name = '']
)
|
|
Adds a "To" address.
Parameters:
|
string |
$address: |
|
|
string |
$name: |
|
API Tags:
| Return: | true on success, false if address already used |
| Access: | public |
bool AddAttachment(
string
$path, [string
$name = ''], [string
$encoding = 'base64'], [string
$type = 'application/octet-stream']
)
|
|
Adds an attachment from a path on the filesystem.
Returns false if the file could not be found or accessed.
Parameters:
|
string |
$path: |
Path to the attachment. |
|
string |
$name: |
Overrides the attachment name. |
|
string |
$encoding: |
File encoding (see $Encoding). |
|
string |
$type: |
File extension (MIME) type. |
API Tags:
boolean AddBCC(
string
$address, [string
$name = '']
)
|
|
Adds a "Bcc" address.
Note: this function works with the SMTP mailer on win32, not with the "mail" mailer.
Parameters:
|
string |
$address: |
|
|
string |
$name: |
|
API Tags:
| Return: | true on success, false if address already used |
| Access: | public |
boolean AddCC(
string
$address, [string
$name = '']
)
|
|
Adds a "Cc" address.
Note: this function works with the SMTP mailer on win32, not with the "mail" mailer.
Parameters:
|
string |
$address: |
|
|
string |
$name: |
|
API Tags:
| Return: | true on success, false if address already used |
| Access: | public |
void AddCustomHeader(
$custom_header
)
|
|
Adds a custom header.
Parameters:
API Tags:
bool AddEmbeddedImage(
string
$path, string
$cid, [string
$name = ''], [string
$encoding = 'base64'], [string
$type = 'application/octet-stream']
)
|
|
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".
Parameters:
|
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. |
API Tags:
string AddrAppend(
$type,
$addr
)
|
|
Creates recipient headers.
Parameters:
API Tags:
boolean AddReplyTo(
string
$address, [string
$name = '']
)
|
|
Adds a "Reply-to" address.
Parameters:
|
string |
$address: |
|
|
string |
$name: |
|
API Tags:
string AddrFormat(
$addr
)
|
|
Formats an address correctly.
Parameters:
API Tags:
void AddStringAttachment(
string
$string, string
$filename, [string
$encoding = 'base64'], [string
$type = 'application/octet-stream']
)
|
|
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.
Parameters:
|
string |
$string: |
String attachment data. |
|
string |
$filename: |
Name of the attachment. |
|
string |
$encoding: |
File encoding (see $Encoding). |
|
string |
$type: |
File extension (MIME) type. |
API Tags:
string Base64EncodeWrapMB(
string
$str
)
|
|
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
Parameters:
|
string |
$str: |
multi-byte text to wrap encode |
API Tags:
Clears all recipients assigned in the TO array. Returns void.
API Tags:
void ClearAllRecipients(
)
|
|
Clears all recipients assigned in the TO, CC and BCC array. Returns void.
API Tags:
Clears all previously set filesystem, string, and binary attachments. Returns void.
API Tags:
Clears all recipients assigned in the BCC array. Returns void.
API Tags:
Clears all recipients assigned in the CC array. Returns void.
API Tags:
void ClearCustomHeaders(
)
|
|
Clears all custom headers. Returns void.
API Tags:
Clears all recipients assigned in the ReplyTo array. Returns void.
API Tags:
Assembles the message body. Returns an empty string on failure.
API Tags:
| Return: | The assembled message body |
| Access: | public |
Assembles message header.
API Tags:
| Return: | The assembled header |
| Access: | public |
void DKIM_Add(
string
$headers_line, string
$subject, string
$body
)
|
|
Create the DKIM header, body, as new header
Parameters:
|
string |
$headers_line: |
Header lines |
|
string |
$subject: |
Subject |
|
string |
$body: |
Body |
API Tags:
void DKIM_BodyC(
string
$body
)
|
|
Generate DKIM Canonicalization Body
Parameters:
|
string |
$body: |
Message Body |
API Tags:
void DKIM_HeaderC(
string
$s
)
|
|
Generate DKIM Canonicalization Header
Parameters:
API Tags:
void DKIM_QP(
$txt, string
$key_filename, string
$key_pass
)
|
|
Set the private key file and password to sign the message.
Parameters:
|
string |
$key_filename: |
Parameter File Name |
|
string |
$key_pass: |
Password for private key |
|
|
$txt: |
|
API Tags:
void DKIM_Sign(
string
$s
)
|
|
Generate DKIM signature
Parameters:
API Tags:
void doCallback(
$isSent,
$to,
$cc,
$bcc,
$subject,
$body
)
|
|
Parameters:
|
|
$isSent: |
|
|
|
$to: |
|
|
|
$cc: |
|
|
|
$bcc: |
|
|
|
$subject: |
|
|
|
$body: |
|
API Tags:
string EncodeHeader(
$str, [
$position = 'text']
)
|
|
Encode a header string to best (shortest) of Q, B, quoted or none.
Parameters:
API Tags:
string EncodeQ(
string
$str, [string
$position = 'text']
)
|
|
Encode string to q encoding.
Parameters:
|
string |
$str: |
the text to encode |
|
string |
$position: |
Where the text is going to be used, see the RFC for what that means |
API Tags:
Information Tags:
string EncodeQP(
string
$string, [integer
$line_max = 76], [boolean
$space_conv = false]
)
|
|
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
Parameters:
|
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 |
API Tags:
Information Tags:
string EncodeQPphp(
[
$input = ''], [integer
$line_max = 76], [
$space_conv = false], string
$string
)
|
|
Encode string to quoted-printable.
Only uses standard PHP, slow, but will always work
Parameters:
|
string |
$string: |
the text to encode |
|
integer |
$line_max: |
Number of chars allowed on a line before wrapping |
|
|
$input: |
|
|
|
$space_conv: |
|
API Tags:
string EncodeString(
string
$str, [string
$encoding = 'base64']
)
|
|
Encodes string to requested format.
Returns an empty string on failure.
Parameters:
|
string |
$str: |
The text to encode |
|
string |
$encoding: |
The encoding to use; one of 'base64', '7bit', '8bit', 'binary', 'quoted-printable' |
API Tags:
Return the current array of attachments
API Tags:
Returns the message MIME.
API Tags:
Return the current array of language strings
API Tags:
bool HasMultiBytes(
string
$str
)
|
|
Checks if a string contains multibyte characters.
Parameters:
|
string |
$str: |
multi-byte text to wrap encode |
API Tags:
string HeaderLine(
$name,
$value
)
|
|
Returns a formatted header line.
Parameters:
API Tags:
bool InlineImageExists(
)
|
|
Returns true if an inline attachment is present.
API Tags:
Returns true if an error occurred.
API Tags:
void IsHTML(
[bool
$ishtml = true]
)
|
|
Sets message type to HTML.
Parameters:
API Tags:
Sets Mailer to send message using PHP mail() function.
API Tags:
Sets Mailer to send message using the qmail MTA.
API Tags:
Sets Mailer to send message using the $Sendmail program.
API Tags:
Sets Mailer to send message using SMTP.
API Tags:
bool MailSend(
string
$header, string
$body
)
|
|
Sends mail using the PHP mail() function.
Parameters:
|
string |
$header: |
The message headers |
|
string |
$body: |
The message body |
API Tags:
$message MsgHTML(
$message, [
$basedir = '']
)
|
|
Evaluates the message and returns modifications for inline images and backgrounds
Parameters:
API Tags:
string SecureHeader(
string
$str
)
|
|
Strips newlines to prevent header injection.
Parameters:
API Tags:
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.
API Tags:
bool SendmailSend(
string
$header, string
$body
)
|
|
Sends mail using the $Sendmail program.
Parameters:
|
string |
$header: |
The message headers |
|
string |
$body: |
The message body |
API Tags:
void set(
string
$name, [mixed
$value = '']
)
|
|
Set (or reset) Class Objects (variables)
Usage Example: $page->set('X-Priority', '3');
Parameters:
|
string |
$name: |
Parameter Name |
|
mixed |
$value: |
Parameter Value NOTE: will not work with arrays, there are no arrays to set/reset |
API Tags:
Adds the error message to the error container.
Parameters:
API Tags:
boolean SetFrom(
string
$address, [string
$name = ''], [
$auto = 1]
)
|
|
Set the From and FromName properties
Parameters:
|
string |
$address: |
|
|
string |
$name: |
|
|
|
$auto: |
|
API Tags:
void 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.
Parameters:
|
string |
$langcode: |
ISO 639-1 2-character language code (e.g. Portuguese: "br") |
|
string |
$lang_path: |
Path to the language file directory |
API Tags:
Set the body wrapping.
API Tags:
void Sign(
$cert_filename, string
$key_filename, string
$key_pass
)
|
|
Set the private key file and password to sign the message.
Parameters:
|
string |
$key_filename: |
Parameter File Name |
|
string |
$key_pass: |
Password for private key |
|
|
$cert_filename: |
|
API Tags:
Closes the active SMTP session if one exists.
API Tags:
Initiates a connection to an SMTP server.
Returns false if the operation failed.
API Tags:
| Access: | public |
| Uses: | SMTP |
bool SmtpSend(
string
$header, string
$body
)
|
|
Sends mail via SMTP using PhpSMTP Returns false if there is a bad MAIL FROM, RCPT, or DATA input.
Parameters:
|
string |
$header: |
The message headers |
|
string |
$body: |
The message body |
API Tags:
| Access: | protected |
| Uses: | SMTP |
string TextLine(
$value
)
|
|
Returns a formatted mail line.
Parameters:
API Tags:
int UTF8CharBoundary(
string
$encodedText, int
$maxLength
)
|
|
Finds last character boundary prior to maxLength in a utf-8 quoted (printable) encoded string.
Original written by Colin Brown.
Parameters:
|
string |
$encodedText: |
utf-8 QP text |
|
int |
$maxLength: |
find last character boundary prior to this length |
API Tags:
string WrapText(
string
$message, integer
$length, [boolean
$qp_mode = false]
)
|
|
Wraps message for use with mailers that do not automatically perform wrapping and for quoted-printable.
Original written by philippe.
Parameters:
|
string |
$message: |
The message to wrap |
|
integer |
$length: |
The line length to wrap to |
|
boolean |
$qp_mode: |
Whether to run in Quoted-Printable mode |
API Tags: