void Mail_mime(
[string
$crlf = "\r\n"]
)
|
|
Constructor function.
Parameters:
|
string |
$crlf: |
what type of linebreak to use. Defaults to "\r\n" |
API Tags:
mixed addAttachment(
string
$file, [string
$c_type = 'application/octet-stream'], [string
$name = ''], [bool
$isfile = true], [string
$encoding = 'base64'], [string
$disposition = 'attachment'], [string
$charset = ''], [string
$language = ''], [string
$location = '']
)
|
|
Adds a file to the list of attachments.
Parameters:
|
string |
$file: |
The file name of the file to attach OR the file contents itself |
|
string |
$c_type: |
The content type |
|
string |
$name: |
The filename of the attachment Only use if $file is the contents |
|
bool |
$isfile: |
Whether $file is a filename or not Defaults to true |
|
string |
$encoding: |
The type of encoding to use. Defaults to base64. Possible values: 7bit, 8bit, base64, or quoted-printable. |
|
string |
$disposition: |
The content-disposition of this file Defaults to attachment. Possible values: attachment, inline. |
|
string |
$charset: |
The character set used in the filename of this attachment. |
|
string |
$language: |
The language of the attachment |
|
string |
$location: |
The RFC 2557.4 location of the attachment |
API Tags:
| Return: | true on success or PEAR_Error object |
| Access: | public |
void addBcc(
string
$email
)
|
|
Add an email to the Bcc (blank carbon copy) header (multiple calls to this method are allowed)
Parameters:
|
string |
$email: |
The email direction to add |
API Tags:
void addCc(
string
$email
)
|
|
Add an email to the Cc (carbon copy) header (multiple calls to this method are allowed)
Parameters:
|
string |
$email: |
The email direction to add |
API Tags:
bool addHTMLImage(
string
$file, [string
$c_type = 'application/octet-stream'], [string
$name = ''], [bool
$isfile = true]
)
|
|
Adds an image to the list of embedded images.
Parameters:
|
string |
$file: |
the image file name OR image data itself |
|
string |
$c_type: |
the content type |
|
string |
$name: |
the filename of the image. Only used if $file is the image data. |
|
bool |
$isfile: |
whether $file is a filename or not. Defaults to true |
API Tags:
| Return: | true on success |
| Access: | public |
string encodeRecipients(
string
$recipients
)
|
|
Since the PHP send function requires you to specifiy recipients (To: header) separately from the other headers, the To: header is not properly encoded.
To fix this, you can use this public method to encode your recipients before sending to the send function
Parameters:
|
string |
$recipients: |
A comma-delimited list of recipients |
API Tags:
| Return: | Encoded data |
| Access: | public |
string &get(
[array
$build_params = null]
)
|
|
Builds the multipart message from the list ($this->_parts) and returns the mime content.
Parameters:
|
array |
$build_params: |
Build parameters that change the way the email is built. Should be associative. Can contain: head_encoding - What encoding to use for the headers. Options: quoted-printable or base64 Default is quoted-printable text_encoding - What encoding to use for plain text Options: 7bit, 8bit, base64, or quoted-printable Default is 7bit html_encoding - What encoding to use for html Options: 7bit, 8bit, base64, or quoted-printable Default is quoted-printable 7bit_wrap - Number of characters before text is wrapped in 7bit encoding Default is 998 html_charset - The character set to use for html. Default is iso-8859-1 text_charset - The character set to use for text. Default is iso-8859-1 head_charset - The character set to use for headers. Default is iso-8859-1 |
API Tags:
| Return: | The mime content |
| Access: | public |
string getMessage(
[string
$separation = null], [array
$build_params = null], [array
$xtra_headers = null], [bool
$overwrite = false]
)
|
|
Returns the complete e-mail, ready to send using an alternative
mail delivery method. Note that only the mailpart that is made with Mail_Mime is created. This means that, YOU WILL HAVE NO TO: HEADERS UNLESS YOU SET IT YOURSELF using the $xtra_headers parameter!
Parameters:
|
string |
$separation: |
The separation etween these two parts. |
|
array |
$build_params: |
The Build parameters passed to the &get() function. See &get for more info. |
|
array |
$xtra_headers: |
The extra headers that should be passed to the &headers() function. See that function for more info. |
|
bool |
$overwrite: |
Overwrite the existing headers with new. |
API Tags:
| Return: | The complete e-mail. |
| Access: | public |
array &headers(
[array
$xtra_headers = null], [bool
$overwrite = false]
)
|
|
Returns an array with the headers needed to prepend to the email (MIME-Version and Content-Type). Format of argument is: $array['header-name'] = 'header-value';
Parameters:
|
array |
$xtra_headers: |
Assoc array with any extra headers. Optional. |
|
bool |
$overwrite: |
Overwrite already existing headers. |
API Tags:
| Return: | Assoc array with the mime headers |
| Access: | public |
void setFrom(
string
$email
)
|
|
Set an email to the From (the sender) header
Parameters:
|
string |
$email: |
The email address to use |
API Tags:
bool setHTMLBody(
string
$data, [bool
$isfile = false]
)
|
|
Adds a html part to the mail.
Parameters:
|
string |
$data: |
either a string or the file name with the contents |
|
bool |
$isfile: |
a flag that determines whether $data is a filename, or a string(false, default) |
API Tags:
| Return: | true on success |
| Access: | public |
void setSubject(
string
$subject
)
|
|
Sets the Subject header
Parameters:
|
string |
$subject: |
String to set the subject to. |
API Tags:
mixed setTXTBody(
string
$data, [bool
$isfile = false], [bool
$append = false]
)
|
|
Accessor function to set the body text. Body text is used if it's not an html mail being sent or else is used to fill the text/plain part that emails clients who don't support html should show.
Parameters:
|
string |
$data: |
Either a string or the file name with the contents |
|
bool |
$isfile: |
If true the first param should be treated as a file name, else as a string (default) |
|
bool |
$append: |
If true the text or file is appended to the existing body, else the old body is overwritten |
API Tags:
| Return: | true on success or PEAR_Error object |
| Access: | public |
string txtHeaders(
[array
$xtra_headers = null], [bool
$overwrite = false]
)
|
|
Get the text version of the headers (usefull if you want to use the PHP mail() function)
Parameters:
|
array |
$xtra_headers: |
Assoc array with any extra headers. Optional. |
|
bool |
$overwrite: |
Overwrite the existing heaers with new. |
API Tags:
| Return: | Plain text headers |
| Access: | public |