1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
| #!/usr/bin/env perl
use strict;
use warnings;
use Email::Stuffer;
use Encode qw(encode decode);
use feature 'say';
my $br = '<br>';
my $str0 = 'Bonjour le monde' . $br;
$str0 .= 'Hello world' . $br;
$str0 .= 'éöî#%' . $br;
$str0 .= join ' ', ( 'Traitements terminés :' . '42' . $br );
$str0 .= join ' ', ( 'Traitements en erreur:' . '42' . $br );
my $str1 = join '', ( '<a href=', '"', 'Texte Infobulle formaté', '"', '>Zone test mouseover</a>' );
my $hdr0 = encode ( 'CP1252', (decode ('UTF-8', "Statistiques" )) );
my $txt0 = encode ( 'CP1252', (decode ('UTF-8', $str0 )) );
my $txt1 = encode ( 'CP1252', (decode ('UTF-8', $str1 )) );
my $html = <<"END";
<h1>$hdr0</h1>
$txt0
$txt1
END
say $html;
Email::Stuffer->to('john@doe.bzh')
->from('guillaume@untel.eu')
->subject('Statistiques')
->html_body($html)
->send; |
Partager