METHODS

See METHODS in Mail::Reporter

$obj->createAttachment( MESSAGE, PART, ARGS )

Create an attachment file, and return a hash with information about that file. Returns undef if creation fails.

This method is used by htmlAttach() and htmlPreview() to create an actual attachment file. It defines url, size and type tags for the template.

Option Default

outdir

<required>

outdir => DIRECTORY
The name of the directory where the external file will be produced must be part of the ARGS hash.
$obj->disposition( MESSAGE, PART, ARGS )

Returns a string, which is either inline, attach, or preview, which indicates how the part of the message should be formatted. This can be changed with setting disposition.

$obj->fields

Returns the field text producing object.

$obj->htmlAddresses( MESSAGE, ARGS )

Produce data about addresses which are in the field. This method uses HTML::FromMail::Field::htmlAddresses() for that.

» Error: use of 'addresses' outside field container
$obj->htmlAttach

The attach container defines url, size and type tags for the template.

» Example: using M
  <!--{message}-->
    <!--{attach}-->
    <!--{/attach}-->
  <!--{/message}-->
$obj->htmlBody( MESSAGE, ARGS )

Produce the body of a field. This tag can only be used inside a field container. See HTML::FromMail::Field::htmlBody() for the use and options.

» Error: use of 'body' outside field container
$obj->htmlField( MESSAGE, ARGS )

Returns the field definition for the currently active message part. When the formatter sees this is a final token, then only the body of the field is returned (and the options of HTML::FromMail::Field::htmlBody() are accepted as well). Otherwise, the information about the field is captured to be used later.

Option Default

decode

<true> if possible

from

PART

name

<required>

decode => BOOLEAN
from => PART|PARENT|MESSAGE
The source of this field: the currently active PART (which may be the main message), the PARENT of the active part (defaults to the message), or the main MESSAGE itself.
name => STRING
» Example: using M
  <!--{field name => To, content => REFOLD, wrap => 20}-->

  <!--{field name => To}-->
     <!--{name capitals => WELLFORMED}-->
     <!--{body wrap => 30}-->
  <!--{/field}-->
» Error: No field name specified in $template
$obj->htmlForeachPart( MESSAGE, ARGS )

Produces html for the parts of a multipart mesasge body. Each part may be a multipart too. For each part, the message container code is applied recursively.

This container defines a part_number, and enables the use of the part tag.

» Example: using M
  <!--{message}-->
    <!--{multipart}-->
      <ul>
      <!--{foreachPart}-->
      <li>This is part <!--{part_number}-->
          <!--{part}-->
      </li>
      <!--{/foreachPart}-->
      </ul>
    <!--{/multipart}-->
  <!--{message}-->
» Error: foreachPart not used within part
» Error: foreachPart outside multipart
$obj->htmlHead( MESSAGE, ARGS )

Defines the fields of a header. The options are provided by HTML::FromMail::Head::fields().

» Example: using M
 # simple
 <pre><!--{head}--></pre>

 # complex
 <table>
 <!--{head remove_spam_groups => 0}-->
   <tr><td><!--{name}--></td>
       <td><!--{body}--></td></tr>
 <!--{/head}-->
 </table>
$obj->htmlInline
Option Default

type

''

type => MIME-TYPE
Selects the MIME types which are handled by this singlepart block. You can specify the types as defined by MIME::Type subroutine equal.
» Example: using M
 <!--{message}-->
    <!--{inline type => text/html}-->
       <!--{html}-->
    <!--{/inline}-->
 <!--{/message}-->
$obj->htmlMessage( MESSAGE, ARGS )

Encapsulated code which is producing the message, which may be a multipart. You have to defined the message block when you use the part (see htmlPart()) tag. If you do not use that, you do not need this.

» Example: using M
  <!--{message}-->
    <!--{inline}-->This is an inlined singlepart<!--{/inline}-->
    <!--{attach}-->This is an attachment<!--{/attach}-->
    <!--{preview}-->An attachment with preview<!--{/preview}-->
    <!--{multipart}-->This is a multipart<!--{/multipart}-->
    <!--{nested}-->message/rfc822 encapsulated<!--{/nested}-->
  <!--{/message}-->
$obj->htmlMultipart( MESSAGE, ARGS )

Encapsulates text to be produced when the message(-part) is a multipart.

$obj->htmlName( MESSAGE, ARGS )

Produce the name of a field. This tag can only be used inside a field container. See HTML::FromMail::Field::htmlName() for the use and options.

» Error: use of 'name' outside field container
$obj->htmlNested( MESSAGE, ARGS )

Contains text to be produced when the message(-part) is a nested message; encapsulated in a message/rfc822.

$obj->htmlPart( MESSAGE, ARGS )

Apply the message container of the current part on its data. See example in htmlForeachPart().

$obj->htmlPreview
Option Default

type

''

type => MIME-TYPE
Selects the MIME types which are handled by this singlepart block. You can specify the types as defined by MIME::Type subroutine equal.
The preview container defines url, size and type tags for the template, which describe the attachment file. Besides, it preview defines a tag which tells whether the preview is made as html or as image. Within an html block, you will get an extra text which includes the actual html preview text.
The image container provides more tags: smallurl, smallwidth, smallheight, width, and height.
» Example: using M
  <!--{message}-->
    <!--{preview}-->
       <!--{html}-->
          <!--{text}-->
       <!--{/html}-->
       <!--{image}-->
          <img src="<!--{smallurl}-->"
           width="<!--{smallwidth}-->"
           height="<!--{smallheight}-->"><br />
           (real is <!--{width}--> x <!--{height}-->)
       <!--{/image}-->
       <a href="<!--{url}-->">Attachment of
        <!--{type}--> (<!--{size}--> bytes)</a>
    <!--{/preview}-->
  <!--{/message}-->
$obj->htmlRawText( MESSAGE, ARGS )

Returns the plain text of the body.

$obj->htmlSubject( MESSAGE, ARGS )

Get the subject field from the message's header, just a short-cut for specifying htmlField(name) with subject.

» Example: using M
  <!--{subject}-->                # message subject
  <!--{field name => subject}-->  # part's subject
  <!--{field name => subject, from => MESSAGE}-->  # message subject
$obj->htmlifier( MIME-TYPE )

Returns the code reference for a routine which can create html for the objects of the specified MIME-TYPE. The TYPE may be a (smartly overloaded) MIME::Type object. The behaviour can be changed with the htmlifiers setting.

$obj->lookup( LABEL, ARGS )
See lookup in HTML::FromMail::Page.
$obj->previewer( MIME-TYPE )

Returns the code reference for a routine which can create a preview for the objects of the specified MIME-TYPE. The TYPE may be a (smartly overloaded) MIME::Type object. The behaviour can be changed with the previewers setting.

Constructors

$class->new( OPTIONS )
Option Defined in Default

log

Mail::Reporter

'WARNINGS'

settings

HTML::FromMail::Object

{}

topic

HTML::FromMail::Object

'message'

trace

Mail::Reporter

'WARNINGS'

log => LEVEL
settings => HASH-OF-HASHES
topic => STRING
trace => LEVEL

Error handling

$obj->AUTOLOAD
See AUTOLOAD in Mail::Reporter.
$obj->addReport( $object )
See addReport in Mail::Reporter.
$obj->defaultTrace( [$level]|[$loglevel, $tracelevel]|[$level, $callback] )
$class->defaultTrace( [$level]|[$loglevel, $tracelevel]|[$level, $callback] )
See defaultTrace in Mail::Reporter.
$obj->errors
See errors in Mail::Reporter.
$obj->log( [$level, [$strings]] )
$class->log( [$level, [$strings]] )
See log in Mail::Reporter.
$obj->logPriority( $level )
$class->logPriority( $level )
See logPriority in Mail::Reporter.
$obj->logSettings
See logSettings in Mail::Reporter.
$obj->notImplemented
See notImplemented in Mail::Reporter.
$obj->report( [$level] )
See report in Mail::Reporter.
$obj->reportAll( [$level] )
See reportAll in Mail::Reporter.
$obj->trace( [$level] )
See trace in Mail::Reporter.
$obj->warnings
See warnings in Mail::Reporter.

Cleanup

$obj->DESTROY
See DESTROY in Mail::Reporter.

Attributes

$obj->settings( [TOPIC] )
See settings in HTML::FromMail::Object.
$obj->topic
See topic in HTML::FromMail::Object.

Export

Other methods

$obj->plain2html( STRING )
See plain2html in HTML::FromMail::Object.