NAME
MIME::Lite::HTML - Provide routine to transform a HTML page in a MIME-Lite mail
SYNOPSIS
use MIME::Lite;
use MIME::Lite::HTML;
my $mailHTML = new MIME::Lite::HTML
From => 'MIME-Lite@alianwebserver.com',
To => 'alian@jupiter',
Subject => 'Mail in HTML with images';
$MIMEmail = $mailHTML->parse('http://www.alianwebserver.com');
$MIMEmail->send; # or for win user : $mail->send_by_smtp('smtp.fai.com');
DESCRIPTION
This module provide routine to transform a HTML page in MIME::Lite mail. The job done is:
+ Get the file (LWP)
+ Parse page to find include images
+ Attach them to mail with adequat cid
+ Include external CSS,Javascript file
+ Replace relative url with absolute one
It can be used by example in a HTML newsletter. You make a classic HTML page, and give just url to MIME::Lite::HTML.
VERSION
$Revision: 0.5 $
METHODS
new(%hash)
Create a new instance of MIME::Lite::HTML.
%hash have this key : From, To, Subject, [Proxy], [Debug], [HashTemplate]
$hash{'HashTemplate'} is a hash too. If present, MIME::Lite::HTML will substitute <? $name ?> with $hash{'HashTemplate'}{'name'} when parse url to send.
parse($url)
Subroutine used for created HTML mail with MIME-Lite
$url : Url to file to parse. Can be a local file.
Return the MIME::Lite part to send
include_css($gabarit,$root)
(private)
Search in HTML buffer ($gabarit) to remplace call to extern CSS file with his content. $root is original absolute url where css file will be found.
include_javascript($gabarit,$root)
(private)
Search in HTML buffer ($gabarit) to remplace call to extern javascript file with his content. $root is original absolute url where javascript file will be found.
input_image($gabarit,$root)
(private)
Search in HTML buffer ($gabarit) to remplace input form image with his cid
Return final buffer and list of MIME::Lite part
link_form($gabarit,$root)
(private)
Replace link to formulaire with absolute link
fill_template($masque,$vars)
$masque : Chemin du template
$vars : hash des noms/valeurs à substituer dans le template
Rend le template avec ses variables substituées. Ex: si $$vars{age}=12, et que le fichier $masque contient la chaine:
J'ai <? $age ?> ans,
la fonction rendra
J'ai 12 ans,
AUTHOR
Alain BARBET alian@alianwebserver.com
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 325:
Non-ASCII character seen before =encoding in 'à'. Assuming CP1252