| core_net

# Class: Bs_HtmlMime Source Location: /core/net/email/Bs_HtmlMime.class.php
### Class Overview
    Bs_Object
       |
       --Bs_HtmlMime
Html/Mime class is used to send emails with html/text combinations and attachements. #### Author(s): Andrej Arn <at blueshoes dot org> (well, just the maintainer, read above) #### Version: 4.3.$Revision: 1.3 $ $Date: 2003/10/29 17:48:41 $ #### Copyright: blueshoes.org | ### Variables $body $build_params $charset $charsetlist $do_html $headers $html $html_images $html_text $image_types $mime $multipart $parts | ### Methods Bs_HtmlMime add_attachment add_header add_html add_html_image build_html build_html_image build_message build_part find_html_images get_encoded_data get_file get_mime get_rfc822 quoted_printable_encode send set_body set_charset
### Inherited Variables | ### Inherited Methods #### Class: Bs_Object Bs_Object::Bs_Object() Bs_Object::getErrors() Basic error handling: Get *all* errors as string array from the global Bs_Error-error stack. Bs_Object::getLastError() Basic error handling: Get last error string from the global Bs_Error-error stack. Bs_Object::getLastErrors() Basic error handling: Get last errors string array from the global Bs_Error-error stack sinc last call of getLastErrors(). Bs_Object::persist() Persists this object by serializing it and saving it to a file with unique name. Bs_Object::setError() Basic error handling: Push an error string on the global Bs_Error-error stack. Bs_Object::toHtml() Dumps the content of this object to a string using PHP's var_dump(). Bs_Object::toString() Dumps the content of this object to a string using PHP's var_dump(). Bs_Object::unpersist() Fetches an object that was persisted with persist()
### Class Details [line 109] Html/Mime class is used to send emails with html/text combinations and attachements. maybe it can be used to receive emails also... features: - missing: - this class is based on (it is nearly only):
     Title.........: HTML Mime Mail class
     Version.......: 1.38
     Author........: Richard Heyes
     Filename......: class.html.mime.mail.class
     Last changed..: 28 August 2001
     License.......: Free to use. If you find it useful
                     though, feel free to buy me something
                     from my wishlist :)
                     http://www.amazon.co.uk/exec/obidos/wishlist/S8H2UOGMPZK6
what does 'free to use' mean? ... license stated at http://www.zend.com/apps.php?CID=169 License: Postcard-ware (Version: 1.1) if there are license problems we can easily replace this code with another class from http://www.zend.com/apps.php?CID=169 or we write our own. i'd much prefer a simpler interface for the coder. #### Tags:
pattern: | singleton: (pseudostatic)
access: | public
version: | 4.3.$Revision: 1.3 $ $Date: 2003/10/29 17:48:41 $
copyright: | blueshoes.org
author: | Andrej Arn <at blueshoes dot org> (well, just the maintainer, read above)
[ Top ] ### Class Variables #### $body = [line 120]
Type: | mixed
[ Top ] #### $build_params = [line 126]
Type: | mixed
[ Top ] #### $charset = [line 129]
Type: | mixed
[ Top ] #### $charsetlist = [line 130]
Type: | mixed
[ Top ] #### $do_html = [line 121]
Type: | mixed
[ Top ] #### $headers = [line 127]
Type: | mixed
[ Top ] #### $html = [line 119]
Type: | mixed
[ Top ] #### $html_images = [line 124]
Type: | mixed
[ Top ] #### $html_text = [line 123]
Type: | mixed
[ Top ] #### $image_types = [line 125]
Type: | mixed
[ Top ] #### $mime = [line 117] finally holds the complete email message (after $this->build_message() has been called.)
Type: | string
[ Top ] #### $multipart = [line 122]
Type: | mixed
[ Top ] #### $parts = [line 128]
Type: | mixed
[ Top ] ### Class Methods ### constructor Bs_HtmlMime [line 138]
`Bs_HtmlMime Bs_HtmlMime( [mixed $headers = ''])`
Constructor. Constructor function. Sets the headers if supplied. [ Top ] ### method add_attachment [line 381]
`void add_attachment( mixed $file, [mixed $name = ''], [mixed $c_type = 'application/octet-stream'])`
************************************* * Adds a file to the list of attachments. ************************************* [ Top ] ### method add_header [line 239]
`void add_header( )`
************************************* * Function to set a header. Shouldn't * really be necessary as you could use * the constructor and send functions, * it's here nonetheless. Takes any number * of arguments, which can be either * strings or arrays full of strings. * this function is php4 only and will * return false otherwise. Will return * true upon finishing. ************************************* [ Top ] ### method add_html [line 347]
`void add_html( mixed $html, mixed $text, [mixed $images_dir = NULL])`
************************************* * Adds a html part to the mail. * Also replaces image names with * content-id's. ************************************* [ Top ] ### method add_html_image [line 367]
`void add_html_image( mixed $file, [mixed $name = ''], [mixed $c_type = 'application/octet-stream'])`
************************************* * Adds an image to the list of embedded * images. ************************************* [ Top ] ### method build_html [line 463]
`void build_html( mixed $orig_boundary)`
************************************* * Builds html part of email. ************************************* [ Top ] ### method build_html_image [line 506]
`void build_html_image( mixed $i)`
************************************* * Builds an embedded image part of an * html mail. ************************************* [ Top ] ### method build_message [line 564]
`void build_message( [mixed $params = array()])`
************************************* * Builds the multipart message from the * list ($this->_parts). $params is an * array of parameters that shape the building * of the message. Currently supported are: * * $params['html_encoding'] - The type of encoding to use on html. Valid options are * "7bit", "quoted-printable" or "base64" (all without quotes). * 7bit is EXPRESSLY NOT RECOMMENDED. Default is quoted-printable * $params['text_encoding'] - The type of encoding to use on plain text Valid options are * "7bit", "quoted-printable" or "base64" (all without quotes). * Default is 7bit * $params['text_wrap'] - The character count at which to wrap 7bit encoded data. By * default this is 998. ************************************* [ Top ] ### method build_part [line 523]
`void build_part( mixed $input)`
************************************* * Builds a single part of a multipart * message. ************************************* [ Top ] ### method find_html_images [line 311]
`void find_html_images( mixed $images_dir)`
************************************* * Function for extracting images from * html source. This function will look * through the html code supplied by add_html() * and find any file that ends in one of the * extensions defined in $obj->image_types. * If the file exists it will read it in and * embed it, (not an attachment). * * Function contributed by Dan Allen ************************************* [ Top ] ### method get_encoded_data [line 434]
`void get_encoded_data( mixed $data, mixed $encoding)`
************************************* * Function to return encoded text/html * based upon the build params. Don't * like this function name :( ************************************* [ Top ] ### method get_file [line 288]
`void get_file( mixed $filename)`
************************************* * This function will read a file in * from a supplied filename and return * it. This can then be given as the first * argument of the the functions * add_html_image() or add_attachment(). ************************************* [ Top ] ### method get_mime [line 221]
`void get_mime( )`
************************************* * Accessor function to return the mime * class variable. Purely for debug. ************************************* [ Top ] ### method get_rfc822 [line 648]
`void get_rfc822( mixed $to_name, mixed $to_addr, mixed $from_name, mixed $from_addr, [mixed $subject = ''], [mixed $headers = ''])`
************************************* * Use this method to return the email * in message/rfc822 format. Useful for * adding an email to another email as * an attachment. there's a commented * out example in example.php. * * string get_rfc822(string To name, * string To email, * string From name, * string From email, * [string Subject, * string Extra headers]) ************************************* [ Top ] ### method quoted_printable_encode [line 395]
`void quoted_printable_encode( mixed $input, [mixed $line_max = 76])`
************************************* * Encodes text to quoted printable standard. * * Function contributed by Allan Hansen ************************************* [ Top ] ### method send [line 610]
`void send( mixed $to_name, mixed $to_addr, mixed $from_name, mixed $from_addr, [mixed $subject = ''], [mixed $headers = ''])`
************************************* * Sends the mail. not recommended. use the smtp class. ************************************* [ Top ] ### method set_body [line 208]
`void set_body( [mixed $text = ''])`
************************************* * Accessor function to set the body text. * Body text is used if it's not an html * mail being sent. ************************************* [ Top ] ### method set_charset [line 262]
`void set_charset( [mixed $charset = ''], [mixed $raw = FALSE])`
************************************* * Accessor function to set the content charset. * * Function contributed by "Matt" ************************************* [ Top ] Documentation generated on Mon, 29 Dec 2003 21:10:54 +0100 by phpDocumentor 1.2.3