Mail
[ class tree: Mail ] [ index: Mail ] [ all elements ]

Class: Mail_mime

Source Location: /Mail_Mime-1.3.0/mime.php

Class Overview


Mime mail composer class. Can handle: text and html bodies, embedded html images and attachments.


Author(s):

Methods


Inherited Variables

Inherited Methods


Class Details

[line 59]
Mime mail composer class. Can handle: text and html bodies, embedded html images and attachments.

Documentation and examples of this class are avaible here: http://pear.php.net/manual/



[ Top ]


Method Detail

Mail_mime (Constructor)   [line 113]

Mail_mime Mail_mime( [ $crlf = "\r\n"])

Constructor function
  • Access: public

Parameters:

   $crlf   — 

[ Top ]

addAttachment   [line 246]

mixed addAttachment( string $file, [string $c_type = 'application/octet-stream'], [string $name = ''], [ $isfilename = true], [ $encoding = 'base64'], bool $isFilename)

Adds a file to the list of attachments.
  • Return: true on success or PEAR_Error object
  • Access: public

Parameters:

string   $file   —  The file name of the file to attach OR the file data itself
string   $c_type   —  The content type
string   $name   —  The filename of the attachment Only use if $file is the file data
bool   $isFilename   —  Whether $file is a filename or not Defaults to true
   $isfilename   — 
   $encoding   — 

[ Top ]

addBcc   [line 655]

void addBcc( string $email)

Add an email to the Bcc (blank carbon copy) header (multiple calls to this method are allowed)
  • Access: public

Parameters:

string   $email   —  The email direction to add

[ Top ]

addCc   [line 639]

void addCc( string $email)

Add an email to the Cc (carbon copy) header (multiple calls to this method are allowed)
  • Access: public

Parameters:

string   $email   —  The email direction to add

[ Top ]

addHTMLImage   [line 211]

mixed addHTMLImage( string $file, [string $c_type = 'application/octet-stream'], [string $name = ''], [bool $isfilename = true])

Adds an image to the list of embedded images.
  • Return: true on success or PEAR_Error object
  • Access: public

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 use if $file is the image data
bool   $isfilename   —  Whether $file is a filename or not Defaults to true

[ Top ]

get   [line 453]

string &get( [array $build_params = null])

Builds the multipart message from the list ($this->_parts) and returns the mime content.
  • Return: The mime content
  • Access: public

Parameters:

array   $build_params   —  Build parameters that change the way the email is built. Should be associative. Can contain: text_encoding - What encoding to use for plain text Default is 7bit html_encoding - What encoding to use for html 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

[ Top ]

headers   [line 578]

array &headers( [array $xtra_headers = null])

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';
  • Return: Assoc array with the mime headers
  • Access: public

Parameters:

array   $xtra_headers   —  Assoc array with any extra headers. Optional.

[ Top ]

setFrom   [line 627]

void setFrom( string $email)

Set an email to the From (the sender) header
  • Access: public

Parameters:

string   $email   —  The email direction to add

[ Top ]

setHTMLBody   [line 184]

mixed setHTMLBody( string $data, [bool $isfile = false])

Adds a html part to the mail
  • Return: true on success or PEAR_Error object
  • Access: public

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)

[ Top ]

setSubject   [line 616]

void setSubject( string $subject)

Sets the Subject header

Parameters:

string   $subject   —  String to set the subject to access public

[ Top ]

setTXTBody   [line 152]

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.
  • Return: true on success or PEAR_Error object
  • Access: public

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

[ Top ]

txtHeaders   [line 600]

string txtHeaders( [array $xtra_headers = null])

Get the text version of the headers (usefull if you want to use the PHP mail() function)
  • Return: Plain text headers
  • Access: public

Parameters:

array   $xtra_headers   —  Assoc array with any extra headers. Optional.

[ Top ]


Documentation generated on Mon, 11 Mar 2019 14:31:07 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.