t3lib_htmlmail Class Reference

Inheritance diagram for t3lib_htmlmail:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 t3lib_htmlmail ()
 start ()
 useQuotedPrintable ()
 useBase64 ()
 use8Bit ()
 encodeMsg ($content)
 addPlain ($content)
 addAttachment ($file)
 addHTML ($file)
 extractHtmlInit ($html, $url)
 send ($recipient)
 setHeaders ()
 setRecipient ($recipient)
 getHTMLContentType ()
 setContent ()
 constructMixed ($boundary)
 constructHTML ($boundary)
 constructAlternative ($boundary)
 constructHTML_media ($boundary)
 sendTheMail ()
 getBoundary ()
 setPlain ($content)
 setHtml ($content)
 add_header ($header)
 add_message ($msg)
 getContent ($type)
 preview ()
 fetchHTML ($file)
 fetchHTMLMedia ()
 extractMediaLinks ()
 extractHyperLinks ()
 extractFramesInfo ()
 substMediaNamesInHTML ($absolute)
 substHREFsInHTML ()
 substHTTPurlsInPlainText ($content)
 fixRollOvers ()
 makeBase64 ($inputstr)
 getExtendedURL ($url)
 addUserPass ($url)
 getURL ($url)
 getStrippedURL ($url)
 getMimeType ($url)
 absRef ($ref)
 split_fileref ($fileref)
 extParseUrl ($path)
 tag_regex ($tags)
 get_tag_attributes ($tag)
 quoted_printable ($string)
 convertName ($name)

Public Attributes

 $recipient = ''
 $recipient_copy = ''
 $subject = ''
 $from_email = ''
 $from_name = ''
 $replyto_email = ''
 $replyto_name = ''
 $organisation = ''
 $priority = 3
 $mailer = ''
 $alt_base64 = 0
 $alt_8bit = 0
 $jumperURL_prefix = ''
 $jumperURL_useId = 0
 $mediaList = ''
 $http_password = ''
 $http_username = ''
 $postfix_version1 = false
 $theParts = array()
 $messageid = ''
 $returnPath = ''
 $Xid = ''
 $dontEncodeHeader = false
 $headers = ''
 $message = ''
 $part = 0
 $image_fullpath_list = ''
 $href_fullpath_list = ''
 $plain_text_header = ''
 $html_text_header = ''
 $charset = ''
 $defaultCharset = 'iso-8859-1'

Detailed Description

Definition at line 183 of file class.t3lib_htmlmail.php.


Member Function Documentation

t3lib_htmlmail::absRef ( ref  ) 

Returns the absolute address of a link. This is based on $this->theParts["html"]["path"] being the root-address

Parameters:
string $ref: address to use
Returns:
string the absolute address

Definition at line 1355 of file class.t3lib_htmlmail.php.

Referenced by extractFramesInfo(), extractHyperLinks(), extractMediaLinks(), fetchHTMLMedia(), fixRollOvers(), substHREFsInHTML(), and substMediaNamesInHTML().

t3lib_htmlmail::add_header ( header  ) 

Adds a header to the mail. Use this AFTER the setHeaders()-function

Parameters:
string $header: the header in form of "key: value"
Returns:
void

Definition at line 816 of file class.t3lib_htmlmail.php.

References t3lib_div::encodeHeader(), and quoted_printable().

Referenced by setContent(), and setHeaders().

t3lib_htmlmail::add_message ( msg  ) 

Adds a line of text to the mail-body. Is normally used internally

Parameters:
string $msg: the message to add
Returns:
void

Definition at line 838 of file class.t3lib_htmlmail.php.

Referenced by constructAlternative(), constructHTML(), constructHTML_media(), constructMixed(), and setContent().

t3lib_htmlmail::addAttachment ( file  ) 

Adds an attachment to the mail

Parameters:
string $file: the filename to add
Returns:
boolean whether the attachment was added or not

Definition at line 366 of file class.t3lib_htmlmail.php.

References getExtendedURL(), and split_fileref().

t3lib_htmlmail::addHTML ( file  ) 

Adds HTML and media, encodes it from a URL or file

Parameters:
string $file: the filename to add
Returns:
boolean whether the attachment was added or not

Definition at line 394 of file class.t3lib_htmlmail.php.

References encodeMsg(), extractFramesInfo(), extractHyperLinks(), extractMediaLinks(), fetchHTML(), fetchHTMLMedia(), setHtml(), substHREFsInHTML(), and substMediaNamesInHTML().

t3lib_htmlmail::addPlain ( content  ) 

Adds plain-text, replaces the HTTP urls in the plain text and then encodes it

Parameters:
string $content that will be added
Returns:
void

Definition at line 354 of file class.t3lib_htmlmail.php.

References $content, encodeMsg(), setPlain(), and substHTTPurlsInPlainText().

Referenced by t3lib_formmail::start().

t3lib_htmlmail::addUserPass ( url  ) 

Adds HTTP user and password (from $this->http_username) to a URL

Parameters:
string $url: the URL
Returns:
string the URL with the added values

Definition at line 1284 of file class.t3lib_htmlmail.php.

Referenced by getURL().

t3lib_htmlmail::constructAlternative ( boundary  ) 

Here plain is combined with HTML

Parameters:
string $boundary: the boundary to use
Returns:
void

Definition at line 640 of file class.t3lib_htmlmail.php.

References add_message(), and getContent().

Referenced by constructHTML().

t3lib_htmlmail::constructHTML ( boundary  ) 

this function creates the HTML part of the mail

Parameters:
string $boundary: the boundary to use
Returns:
void

Definition at line 613 of file class.t3lib_htmlmail.php.

References add_message(), constructAlternative(), constructHTML_media(), and getBoundary().

Referenced by constructMixed(), and setContent().

t3lib_htmlmail::constructHTML_media ( boundary  ) 

Constructs the HTML-part of message if the HTML contains media

Parameters:
string $boundary: the boundary to use
Returns:
void

Definition at line 663 of file class.t3lib_htmlmail.php.

References $key, add_message(), t3lib_div::inList(), and makeBase64().

Referenced by constructHTML().

t3lib_htmlmail::constructMixed ( boundary  ) 

This functions combines the plain / HTML content with the attachments

Parameters:
string $boundary: the mail boundary
Returns:
void

Definition at line 574 of file class.t3lib_htmlmail.php.

References add_message(), constructHTML(), getBoundary(), getContent(), getHTMLContentType(), and makeBase64().

Referenced by setContent().

t3lib_htmlmail::convertName ( name  ) 

Converts a name field Deprecated since TYPO3 4.0

Parameters:
string $name: the name
Returns:
string the name
Deprecated:
since TYPO3 4.0, remove in TYPO3 4.3

Definition at line 1498 of file class.t3lib_htmlmail.php.

t3lib_htmlmail::encodeMsg ( content  ) 

Encodes the message content according to the options "alt_base64" and "alt_8bit" (no need to encode here) or to "quoted_printable" if no option is set.

Parameters:
string $content the content that will be encoded
Returns:
string the encoded content

Definition at line 337 of file class.t3lib_htmlmail.php.

References $content, makeBase64(), and t3lib_div::quoted_printable().

Referenced by addHTML(), addPlain(), and t3lib_formmail::start().

t3lib_htmlmail::extParseUrl ( path  ) 

Returns an array with file or url-information

Parameters:
string $path: url to check
Returns:
array information about the path / URL

Definition at line 1404 of file class.t3lib_htmlmail.php.

References $res.

Referenced by fetchHTML().

t3lib_htmlmail::extractFramesInfo (  ) 

extracts all media-links from $this->theParts["html"]["content"]

Returns:
array two-dimensional array with information about each frame

Definition at line 1066 of file class.t3lib_htmlmail.php.

References absRef(), get_tag_attributes(), and tag_regex().

Referenced by addHTML().

t3lib_htmlmail::extractHtmlInit ( html,
url 
)

Extract HTML-parts, used externally

Parameters:
string $html: will be added to the html "content" part
string $url: will be added to the html "path" part
Returns:
void

Definition at line 418 of file class.t3lib_htmlmail.php.

t3lib_htmlmail::extractHyperLinks (  ) 

extracts all hyper-links from $this->theParts["html"]["content"]

Returns:
void

Definition at line 1013 of file class.t3lib_htmlmail.php.

References absRef(), get_tag_attributes(), and tag_regex().

Referenced by addHTML().

t3lib_htmlmail::extractMediaLinks (  ) 

extracts all media-links from $this->theParts['html']['content']

Returns:
void

Definition at line 921 of file class.t3lib_htmlmail.php.

References absRef(), get_tag_attributes(), split_fileref(), and tag_regex().

Referenced by addHTML().

t3lib_htmlmail::fetchHTML ( file  ) 

Fetches the HTML-content from either url og local serverfile

Parameters:
string $file: the file to load
Returns:
boolean whether the data was fetched or not

Definition at line 884 of file class.t3lib_htmlmail.php.

References extParseUrl(), and getURL().

Referenced by addHTML().

t3lib_htmlmail::fetchHTMLMedia (  ) 

Fetches the mediafiles which are found by extractMediaLinks()

Returns:
void

Definition at line 903 of file class.t3lib_htmlmail.php.

References $key, absRef(), and getExtendedURL().

Referenced by addHTML().

t3lib_htmlmail::fixRollOvers (  ) 

JavaScript rollOvers cannot support graphics inside of mail. If these exists we must let them refer to the absolute url. By the way: Roll-overs seems to work only on some mail-readers and so far I've seen it work on Netscape 4 message-center (but not 4.5!!)

Returns:
void

Definition at line 1189 of file class.t3lib_htmlmail.php.

References $key, $part, and absRef().

Referenced by substMediaNamesInHTML().

t3lib_htmlmail::get_tag_attributes ( tag  ) 

This function analyzes a HTML tag If an attribute is empty (like OPTION) the value of that key is just empty. Check it with is_set();

Parameters:
string $tag: is either like this "<TAG OPTION ATTRIB=VALUE>" or this " OPTION ATTRIB=VALUE>" which means you can omit the tag-name
Returns:
array array with attributes as keys in lower-case

Definition at line 1439 of file class.t3lib_htmlmail.php.

References $value.

Referenced by extractFramesInfo(), extractHyperLinks(), and extractMediaLinks().

t3lib_htmlmail::getBoundary (  ) 

Returns boundaries

Returns:
string the boundary

Definition at line 782 of file class.t3lib_htmlmail.php.

Referenced by constructHTML(), constructMixed(), and setContent().

t3lib_htmlmail::getContent ( type  ) 

returns the content specified by the type (plain, html etc.)

Parameters:
string $type: the content type, can either plain or html
Returns:
void

Definition at line 849 of file class.t3lib_htmlmail.php.

Referenced by constructAlternative(), constructMixed(), and setContent().

t3lib_htmlmail::getExtendedURL ( url  ) 

reads the URL or file and determines the Content-type by either guessing or opening a connection to the host

Parameters:
string $url: the URL to get information of
Returns:
mixed either false or the array with information

Definition at line 1246 of file class.t3lib_htmlmail.php.

References $res, getMimeType(), getURL(), and split_fileref().

Referenced by addAttachment(), and fetchHTMLMedia().

t3lib_htmlmail::getHTMLContentType (  ) 

Returns the content type based on whether the mail has media / attachments or no

Returns:
string the content type

Definition at line 533 of file class.t3lib_htmlmail.php.

Referenced by constructMixed(), and setContent().

t3lib_htmlmail::getMimeType ( url  ) 

This function returns the mime type of the file specified by the url

Parameters:
string $url: the url
Returns:
string $mimeType: the mime type found in the header

Definition at line 1335 of file class.t3lib_htmlmail.php.

References $headers, and t3lib_div::getURL().

Referenced by getExtendedURL().

t3lib_htmlmail::getStrippedURL ( url  ) 

reads a url or file and strips the HTML-tags AND removes all empty lines. This is used to read plain-text out of a HTML-page

Parameters:
string $url: the URL to load
Returns:
the content

Definition at line 1314 of file class.t3lib_htmlmail.php.

References $content.

t3lib_htmlmail::getURL ( url  ) 

reads a url or file

Parameters:
string $url: the URL to fetch
Returns:
string the content of the URL

Definition at line 1301 of file class.t3lib_htmlmail.php.

References addUserPass(), and t3lib_div::getURL().

Referenced by t3lib_formmail::addAttachment(), fetchHTML(), and getExtendedURL().

t3lib_htmlmail::makeBase64 ( inputstr  ) 

Returns base64-encoded content, which is broken every 76 character

Parameters:
string $inputstr: the string to encode
Returns:
string the encoded string

Definition at line 1235 of file class.t3lib_htmlmail.php.

Referenced by constructHTML_media(), constructMixed(), and encodeMsg().

t3lib_htmlmail::preview (  ) 

shows a preview of the email of the headers and the message

Returns:
void

Definition at line 859 of file class.t3lib_htmlmail.php.

t3lib_htmlmail::quoted_printable ( string  ) 

Implementation of quoted-printable encode. This function was a duplicate of t3lib_div::quoted_printable, thus it's going to be removed. Deprecated since TYPO3 4.0

Parameters:
string Content to encode
Returns:
string The QP encoded string
Deprecated:
since TYPO3 4.0, remove in TYPO 4.3

Definition at line 1485 of file class.t3lib_htmlmail.php.

References t3lib_div::quoted_printable().

Referenced by add_header(), and setHeaders().

t3lib_htmlmail::send ( recipient  ) 

Assembles the message by headers and content and finally send it to the provided recipient.

Parameters:
string 
recipient
The recipient the message should be delivered to (if blank,
this->recipient will be used instead)
Returns:
boolean Returns whether the mail was sent (successfully accepted for delivery)

Definition at line 430 of file class.t3lib_htmlmail.php.

References $recipient, sendTheMail(), setContent(), and setHeaders().

t3lib_htmlmail::sendTheMail (  ) 

Sends the mail by calling the mail() function in php. On Linux systems this will invoke the MTA defined in php.ini (sendmail -t -i by default), on Windows a SMTP must be specified in the sys.ini. Most common MTA's on Linux has a Sendmail interface, including Postfix and Exim. For setting the return-path correctly, the parameter -f has to be added to the system call to sendmail. This obviously does not have any effect on Windows, but on Sendmail compliant systems this works. If safe mode is enabled, then extra parameters is not allowed, so a safe mode check is made before the mail() command is invoked. When using the -f parameter, some MTA's will put an X-AUTHENTICATION-WARNING saying that the return path was modified manually with the -f flag. To disable this warning make sure that the user running Apache is in the /etc/mail/trusted-users table.

POSTFIX: With postfix version below 2.0 there is a problem that the -f parameter can not be used in conjunction with -t. Postfix will give an error in the maillog:

cannot handle command-line recipients with -t

The -f parameter is only enabled if the parameter forceReturnPath is enabled in the install tool.

This whole problem of return-path turns out to be quite tricky. If you have a solution that works better, on all standard MTA's then we are very open for suggestions.

With time this function should be made such that several ways of sending the mail is possible (local MTA, smtp other).

Returns:
boolean Returns whether the mail was sent (successfully accepted for delivery)

Definition at line 706 of file class.t3lib_htmlmail.php.

References $recipient, $recipient_copy, $returnPath, $theParts, and t3lib_div::normalizeMailAddress().

Referenced by send().

t3lib_htmlmail::setContent (  ) 

Begins building the message-body

Returns:
void

Definition at line 543 of file class.t3lib_htmlmail.php.

References add_header(), add_message(), constructHTML(), constructMixed(), getBoundary(), getContent(), and getHTMLContentType().

Referenced by send(), and t3lib_formmail::start().

t3lib_htmlmail::setHeaders (  ) 

Clears the header-string and sets the headers based on object-vars.

Returns:
void

Definition at line 463 of file class.t3lib_htmlmail.php.

References add_header(), t3lib_div::encodeHeader(), t3lib_div::isBrokenEmailEnvironment(), and quoted_printable().

Referenced by send(), and t3lib_formmail::start().

t3lib_htmlmail::setHtml ( content  ) 

Sets the HTML-part. No processing done.

Parameters:
string $content: the HTML content
Returns:
void

Definition at line 805 of file class.t3lib_htmlmail.php.

References $content.

Referenced by addHTML().

t3lib_htmlmail::setPlain ( content  ) 

Sets the plain-text part. No processing done.

Parameters:
string $content: the plain content
Returns:
void

Definition at line 794 of file class.t3lib_htmlmail.php.

References $content.

Referenced by addPlain().

t3lib_htmlmail::setRecipient ( recipient  ) 

Sets the recipient(s). If you supply a string, you set one recipient. If you supply an array, every value is added as a recipient.

Parameters:
mixed $recipient: the recipient(s) to set
Returns:
void

Definition at line 523 of file class.t3lib_htmlmail.php.

References $recipient.

Referenced by t3lib_formmail::start().

t3lib_htmlmail::split_fileref ( fileref  ) 

Returns information about a file reference

Parameters:
string $fileref: the file to use
Returns:
array path, filename, filebody, fileext

Definition at line 1376 of file class.t3lib_htmlmail.php.

Referenced by addAttachment(), t3lib_formmail::addAttachment(), extractMediaLinks(), and getExtendedURL().

t3lib_htmlmail::start (  ) 

start action that sets the message ID and the charset

Returns:
void

Definition at line 259 of file class.t3lib_htmlmail.php.

References $GLOBALS, $TYPO3_CONF_VARS, t3lib_div::getHostname(), and useQuotedPrintable().

t3lib_htmlmail::substHREFsInHTML (  ) 

This function substitutes the hrefs in $this->theParts["html"]["content"]

Returns:
void

Definition at line 1120 of file class.t3lib_htmlmail.php.

References $key, $val, and absRef().

Referenced by addHTML().

t3lib_htmlmail::substHTTPurlsInPlainText ( content  ) 

This substitutes the http:// urls in plain text with links

Parameters:
string $content: the content to use to substitute
Returns:
string the changed content

Definition at line 1147 of file class.t3lib_htmlmail.php.

References $content.

Referenced by addPlain().

t3lib_htmlmail::substMediaNamesInHTML ( absolute  ) 

This function substitutes the media-references in $this->theParts["html"]["content"]

Parameters:
boolean $absolute: If true, then the refs are substituted with http:// ref's indstead of Content-ID's (cid).
Returns:
void

Definition at line 1095 of file class.t3lib_htmlmail.php.

References $key, $val, absRef(), and fixRollOvers().

Referenced by addHTML().

t3lib_htmlmail::t3lib_htmlmail (  ) 

Constructor. If the configuration variable forceReturnPath is set, calls to mail will be called with a 5th parameter. See function sendTheMail for more info

Returns:
void

Definition at line 247 of file class.t3lib_htmlmail.php.

References $GLOBALS.

t3lib_htmlmail::tag_regex ( tags  ) 

Creates a regular expression out of a list of tags

Parameters:
mixed $tagArray: the list of tags (either as array or string if it is one tag)
Returns:
string the regular expression

Definition at line 1419 of file class.t3lib_htmlmail.php.

Referenced by extractFramesInfo(), extractHyperLinks(), and extractMediaLinks().

t3lib_htmlmail::use8Bit (  ) 

sets the encoding to 8bit and the current charset of both the Plain Text and the HTML mail

Returns:
void

Definition at line 323 of file class.t3lib_htmlmail.php.

t3lib_htmlmail::useBase64 (  ) 

sets the encoding headers to base64 for both the Plain Text and HTML mail

Returns:
void

Definition at line 311 of file class.t3lib_htmlmail.php.

Referenced by t3lib_formmail::start().

t3lib_htmlmail::useQuotedPrintable (  ) 

sets the header of both Plain Text and HTML mails to quoted printable

Returns:
void

Definition at line 301 of file class.t3lib_htmlmail.php.

Referenced by start().


Member Data Documentation

t3lib_htmlmail::$alt_8bit = 0

Definition at line 196 of file class.t3lib_htmlmail.php.

t3lib_htmlmail::$alt_base64 = 0

Definition at line 195 of file class.t3lib_htmlmail.php.

t3lib_htmlmail::$charset = ''

Definition at line 235 of file class.t3lib_htmlmail.php.

t3lib_htmlmail::$defaultCharset = 'iso-8859-1'

Definition at line 236 of file class.t3lib_htmlmail.php.

t3lib_htmlmail::$dontEncodeHeader = false

Definition at line 225 of file class.t3lib_htmlmail.php.

t3lib_htmlmail::$from_email = ''

Definition at line 188 of file class.t3lib_htmlmail.php.

t3lib_htmlmail::$from_name = ''

Definition at line 189 of file class.t3lib_htmlmail.php.

t3lib_htmlmail::$headers = ''

Definition at line 227 of file class.t3lib_htmlmail.php.

Referenced by getMimeType().

t3lib_htmlmail::$href_fullpath_list = ''

Definition at line 231 of file class.t3lib_htmlmail.php.

t3lib_htmlmail::$html_text_header = ''

Definition at line 234 of file class.t3lib_htmlmail.php.

t3lib_htmlmail::$http_password = ''

Definition at line 200 of file class.t3lib_htmlmail.php.

t3lib_htmlmail::$http_username = ''

Definition at line 201 of file class.t3lib_htmlmail.php.

t3lib_htmlmail::$image_fullpath_list = ''

Definition at line 230 of file class.t3lib_htmlmail.php.

t3lib_htmlmail::$jumperURL_prefix = ''

Definition at line 197 of file class.t3lib_htmlmail.php.

t3lib_htmlmail::$jumperURL_useId = 0

Definition at line 198 of file class.t3lib_htmlmail.php.

t3lib_htmlmail::$mailer = ''

Definition at line 194 of file class.t3lib_htmlmail.php.

t3lib_htmlmail::$mediaList = ''

Definition at line 199 of file class.t3lib_htmlmail.php.

t3lib_htmlmail::$message = ''

Definition at line 228 of file class.t3lib_htmlmail.php.

t3lib_htmlmail::$messageid = ''

Definition at line 222 of file class.t3lib_htmlmail.php.

t3lib_htmlmail::$organisation = ''

Definition at line 192 of file class.t3lib_htmlmail.php.

t3lib_htmlmail::$part = 0

Definition at line 229 of file class.t3lib_htmlmail.php.

Referenced by fixRollOvers().

t3lib_htmlmail::$plain_text_header = ''

Definition at line 233 of file class.t3lib_htmlmail.php.

t3lib_htmlmail::$postfix_version1 = false

Definition at line 202 of file class.t3lib_htmlmail.php.

t3lib_htmlmail::$priority = 3

Definition at line 193 of file class.t3lib_htmlmail.php.

t3lib_htmlmail::$recipient = ''

Definition at line 185 of file class.t3lib_htmlmail.php.

Referenced by send(), sendTheMail(), and setRecipient().

t3lib_htmlmail::$recipient_copy = ''

Definition at line 186 of file class.t3lib_htmlmail.php.

Referenced by sendTheMail().

t3lib_htmlmail::$replyto_email = ''

Definition at line 190 of file class.t3lib_htmlmail.php.

t3lib_htmlmail::$replyto_name = ''

Definition at line 191 of file class.t3lib_htmlmail.php.

t3lib_htmlmail::$returnPath = ''

Definition at line 223 of file class.t3lib_htmlmail.php.

Referenced by sendTheMail().

t3lib_htmlmail::$subject = ''

Definition at line 187 of file class.t3lib_htmlmail.php.

t3lib_htmlmail::$theParts = array()

Definition at line 220 of file class.t3lib_htmlmail.php.

Referenced by sendTheMail().

t3lib_htmlmail::$Xid = ''

Definition at line 224 of file class.t3lib_htmlmail.php.


The documentation for this class was generated from the following file:
Generated on Sat Jan 3 04:23:48 2009 for TYPO3 API by  doxygen 1.4.7