The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

HTML::FromMail::Field - output a header field as HTML

INHERITANCE

 HTML::FromMail::Field
   is a HTML::FromMail::Page
   is a HTML::FromMail::Object
   is a Mail::Reporter

SYNOPSIS

DESCRIPTION

METHODS

$obj->addressField(FIELD, HOW, ARGS)

    Produce text for a header field containing addresses. HOW this is done is defining the result. Possible values are 'ADDRESS', 'PHRASE', 'PLAIN', 'MAILTO', or 'LINK'. See "address HOW" for details.

$obj->fromHead(HEAD, NAME, ARGS)

    Returns the fields from the header with NAME. Some fields appear more than once, some may not be present.

$obj->htmlAddresses(FIELD, ARGS)

    Returns an array with address info.

$obj->htmlBody(ARGS)

    Produce the body of the field: everything after the first colon on the header line.

     Option   Defined in       Default    
     address                   C<'MAILTO'>
     content                   <depends>  
     wrap                      C<78>      

    . address ADDRESS|PHRASE|PLAIN|MAILTO|LINK

    . content FOLDED|REFOLD|UNFOLDED|DECODED

      How to included the body of the field. If a wrap is defined, then REFOLD is taken as default, otherwise DECODED is the default. See "content HOW"

    . wrap INTEGER

      In combination with content REFOLD, it specifies the maximum number of characters requested per line. See "wrap INTEGER".

$obj->htmlName(ARGS)

    Returns the name of the header field.

     Option    Defined in  Default    
     capitals              'UNCHANGED'

    . capitals 'UNCHANGED'|'WELLFORMED'

$obj->lookup(LABEL, ARGS)

HTML::FromMail::Field->new(OPTIONS)

     Option    Defined in       Default   
     settings  L<HTML::FromMail::Object>  {}        
     topic     L<HTML::FromMail::Object>  C<'field'>

    . settings HASH-OF-HASHES

    . topic STRING

Attributes

$obj->settings([TOPIC])

$obj->topic

Export

Other methods

$obj->plain2html(STRING)

DETAILS

Settings

You can specify the following settings in HTML::FromMail::new(settings) for topic field:

address HOW

Some fields are pre-defined to contain e-mail addresses. In many web-based clients, you see that these addresses are bluntly linked to, but you here have a choice. As example, the header field contains the address "My Name" <me@example.com> you@example.com

The possible settings for this parameter are

  • 'PHRASE'

    According to the standards, the phrase is ment to represent the user in an understandable way. Usually this is the full name of the user. No link is made. My Name you@example.com

  • 'ADDRESS'

    Only show the address of the users. my@example.com you@example.com

  • 'MAILTO'

    Create a link behind the phrase. In case there is no phrase, the address itself is displayed. This is the most convenient link, if you decide to create a link. <a href="mailto:me@example.com">My Name </a > <a href="mailto:you@example.com">you@example.com </a >

  • 'LINK'

    Often seen, but more for simplicity of implementation is the link under the address. The 'MAILTO' is probably easier to understand. "My Name" <a href="mailto:me@example.com">me@example.com </a >

     E<lt>a href="mailto:you@example.com"E<gt>you@example.com E<lt>/a E<gt>
    =back

content HOW

Defined HOW field bodies are handled, by default UNFOLDED.

Valid values are

    folding will be lost again. =item 'REFOLD' Do not accept the folding as found in the message headers, but force it

    into the wrap which is defined by wrap. =item 'UNFOLDED' All line folding is removed from the field. This useful when the field body

    is displayed in a proportional font. =item 'DECODED' Fields may be character-set encoded. Decoding these fields is nicest,

    but consumes considerable time. =back

names HOW

Defines HOW field names are displayed: either 'WELLFORMED' or 'UNCHANGED'. Field names have a certain capitization (as defined by the message), but this may be different from the preferred use of capitals. The correct use of capitals is implemented by Mail::Message::Field subroutine wellformedName and will be used when WELLFORMED is selected. By default, the names are displayed UNCHANGED.

Example: using HTML::FromMail::Format::Magic

  <!--{name capitals => WELLFORMED}-->

wrap INTEGER

Used in combination with content REFOLD, to specify how many characters are requested per line.

REFERENCES

See the HTML::FromMail website at http://perl.overmeer.net/html-from-mail/ for more details.

COPYRIGHTS

Module version 0.10. Written by Mark Overmeer (mark@overmeer.net). See the ChangeLog for other contributors.

Copyright (c) 2003 by the author(s). All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

4 POD Errors

The following errors were encountered while parsing the POD:

Around line 192:

=over should be: '=over' or '=over positive_number'

Around line 230:

You forgot a '=back' before '=head3'

Around line 236:

=over should be: '=over' or '=over positive_number'

Around line 256:

You forgot a '=back' before '=head3'