Mail::Message::Convert::Html
Format messages in HTML
- Provided by: libmail-message-perl (Version: 4.03-1)
- Report a bug
Format messages in HTML
Mail::Message::Convert::Html is a Mail::Message::Convert is a Mail::Reporter
use Mail::Message::Convert::Html; my $Html = Mail::Message::Convert::Html->new; print $html->fieldToHtml($head); print $html->headToHtmlHead($head); print $html->headToHtmlTable($head); print $html->textToHtml($text);
The package contains various translators which handle HTML or XHTML without the help of external modules. There are more HTML related modules, which do require extra packages to be installed.
Extends "DESCRIPTION" in Mail::Message::Convert.
Extends "METHODS" in Mail::Message::Convert.
Extends "Constructors" in Mail::Message::Convert.
-Option --Defined in --Default
fields Mail::Message::Convert <see description>
head_mailto true
produce HTML
Extends "Attributes" in Mail::Message::Convert.
Extends "Converting" in Mail::Message::Convert.
Besides, you can specify your own meta fields, which will overrule header fields. Empty fields will not be included. When a "title" is specified, this will become the html title, otherwise the "Subject" field is taken. In list context, the lines are separately, where in scalar context the whole text is returned as one.
If you need to add lines to the head (for instance, http-equiv lines), then splice them before the last element in the returned list.
» example:
my @head = $html->headToHtmlHead(
$head,
description => 'This is a message',
generator => 'Mail::Box',
);
splice @head, -1, 0, '<meta http-equiv=...>';
print @head;
» example:
print $html->headToHtmlTable($head, 'width="50%"');
Extends "Error handling" in Mail::Message::Convert.
Extends "Cleanup" in Mail::Message::Convert.
This module is part of Mail-Message version 4.03, built on January 26, 2026. Website: http://perl.overmeer.net/CPAN/
For contributors see file ChangeLog.
This software is copyright (c) 2001-2026 by Mark Overmeer.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.