[ Index ]
 

Code source de SPIP Agora 1.4

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/Pear/Mail/ -> mime.php (sommaire)

(pas de description)

Poids: 713 lignes (25 kb)
Inclus ou requis:0 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 1 class

Mail_mime:: (23 méthodes):
  Mail_mime()
  __wakeup()
  setTXTBody()
  setHTMLBody()
  addHTMLImage()
  addAttachment()
  _file2str()
  _addTextPart()
  _addHtmlPart()
  _addMixedPart()
  _addAlternativePart()
  _addRelatedPart()
  _addHtmlImagePart()
  _addAttachmentPart()
  get()
  headers()
  txtHeaders()
  setSubject()
  setFrom()
  addCc()
  addBcc()
  _encodeHeaders()
  _setEOL()


Classe: Mail_mime  - X-Ref

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/

Mail_mime($crlf = "\r\n")   X-Ref
Constructor function


__wakeup()   X-Ref
Wakeup (unserialize) - re-sets EOL constant


setTXTBody($data, $isfile = false, $append = false)   X-Ref
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.

param: string  $data   Either a string or
param: bool    $isfile If true the first param should be treated
param: bool    $append If true the text or file is appended to
return: mixed   true on success or PEAR_Error object

setHTMLBody($data, $isfile = false)   X-Ref
Adds a html part to the mail

param: string  $data   Either a string or the file name with the
param: bool    $isfile If true the first param should be treated
return: mixed   true on success or PEAR_Error object

addHTMLImage($file, $c_type='application/octet-stream',$name = '', $isfilename = true)   X-Ref
Adds an image to the list of embedded images.

param: string  $file       The image file name OR image data itself
param: string  $c_type     The content type
param: string  $name       The filename of the image.
param: bool    $isfilename Whether $file is a filename or not
return: mixed   true on success or PEAR_Error object

addAttachment($file, $c_type = 'application/octet-stream',$name = '', $isfilename = true,$encoding = 'base64')   X-Ref
Adds a file to the list of attachments.

param: string  $file       The file name of the file to attach
param: string  $c_type     The content type
param: string  $name       The filename of the attachment
param: bool    $isFilename Whether $file is a filename or not
return: mixed true on success or PEAR_Error object

_file2str($file_name)   X-Ref
Get the contents of the given file name as string

param: string  $file_name  path of file to process
return: string  contents of $file_name

_addTextPart(&$obj, $text)   X-Ref
Adds a text subpart to the mimePart object and
returns it during the build process.

param: mixed    The object to add the part to, or
param: string   The text to add.
return: object  The text mimePart object

_addHtmlPart(&$obj)   X-Ref
Adds a html subpart to the mimePart object and
returns it during the build process.

param: mixed   The object to add the part to, or
return: object  The html mimePart object

_addMixedPart()   X-Ref
Creates a new mimePart object, using multipart/mixed as
the initial content-type and returns it during the
build process.

return: object  The multipart/mixed mimePart object

_addAlternativePart(&$obj)   X-Ref
Adds a multipart/alternative part to a mimePart
object (or creates one), and returns it during
the build process.

param: mixed   The object to add the part to, or
return: object  The multipart/mixed mimePart object

_addRelatedPart(&$obj)   X-Ref
Adds a multipart/related part to a mimePart
object (or creates one), and returns it during
the build process.

param: mixed    The object to add the part to, or
return: object  The multipart/mixed mimePart object

_addHtmlImagePart(&$obj, $value)   X-Ref
Adds an html image subpart to a mimePart object
and returns it during the build process.

param: object  The mimePart to add the image to
param: array   The image information
return: object  The image mimePart object

_addAttachmentPart(&$obj, $value)   X-Ref
Adds an attachment subpart to a mimePart object
and returns it during the build process.

param: object  The mimePart to add the image to
param: array   The attachment information
return: object  The image mimePart object

get($build_params = null)   X-Ref
Builds the multipart message from the list ($this->_parts) and
returns the mime content.

param: array  Build parameters that change the way the email
return: string The mime content

headers($xtra_headers = null)   X-Ref
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';

param: array $xtra_headers Assoc array with any extra headers.
return: array Assoc array with the mime headers

txtHeaders($xtra_headers = null)   X-Ref
Get the text version of the headers
(usefull if you want to use the PHP mail() function)

param: array   $xtra_headers Assoc array with any extra headers.
return: string  Plain text headers

setSubject($subject)   X-Ref
Sets the Subject header

param: string $subject String to set the subject to

setFrom($email)   X-Ref
Set an email to the From (the sender) header

param: string $email The email direction to add

addCc($email)   X-Ref
Add an email to the Cc (carbon copy) header
(multiple calls to this method are allowed)

param: string $email The email direction to add

addBcc($email)   X-Ref
Add an email to the Bcc (blank carbon copy) header
(multiple calls to this method are allowed)

param: string $email The email direction to add

_encodeHeaders($input)   X-Ref
Encodes a header as per RFC2047

param: string  $input The header data to encode
return: string  Encoded data

_setEOL($eol)   X-Ref
Set the object's end-of-line and define the constant if applicable

param: string $eol End Of Line sequence



Généré le : Sat Feb 24 14:40:03 2007 par Balluche grâce à PHPXref 0.7