');
is(decode_utf8($parsed_mail->{subject}), 'Sübject');
is(decode_utf8($parsed_mail->{content}->findnodes('//p')->[0]->as_text), 'Umlaute: äöüßÄÖÜ');
done_testing();
sub generate_address {
my ($name, $address) = @_;
return Email::Address->new(
encode_mimeword(encode_utf8($name), 'Q', 'UTF-8'),
encode_utf8($address)
);
}
sub parse_mail {
my ($mail) = @_;
my $parser = MIME::Parser->new();
$parser->output_to_core(1);
my $parsed_mail = $parser->parse_data($mail);
my $subject = MIME::Words::decode_mimewords( $parsed_mail->head->get('Subject') );
my $from = MIME::Words::decode_mimewords( $parsed_mail->head->get('From') );
my $to = MIME::Words::decode_mimewords( $parsed_mail->head->get('To') );
defined and chomp foreach ($subject, $from, $to);
return {
content => HTML::TreeBuilder::XPath->new_from_content($parsed_mail->bodyhandle->as_string),
subject => $subject,
from => $from,
to => $to,
};
}
Email-MIME-CreateHTML-1.042/t/data/ 0000755 0000000 0000000 00000000000 13232735365 015045 5 ustar root root Email-MIME-CreateHTML-1.042/t/data/CreateHTML_04a.html 0000644 0000000 0000000 00000000317 13232735365 020270 0 ustar root root
Hello HTML World
Look! a nice
This is the again.
Email-MIME-CreateHTML-1.042/t/data/test_style.css 0000644 0000000 0000000 00000000064 13232735365 017756 0 ustar root root body {
font-family: Verdana, Arial, sans-serif;
}
Email-MIME-CreateHTML-1.042/t/data/CreateHTML_03a.html 0000644 0000000 0000000 00000000316 13232735365 020266 0 ustar root root
Hello HTML World with an image using a Content-ID
and some ISO-8859-1 extended chars: a cote les yeux de la tte
Email-MIME-CreateHTML-1.042/t/data/CreateHTML_04b.html 0000644 0000000 0000000 00000000274 13232735365 020273 0 ustar root root
Hello HTML World
Look! a nice
This is the again.
Email-MIME-CreateHTML-1.042/t/data/CreateHTML_01.html 0000644 0000000 0000000 00000000560 13232735365 020124 0 ustar root root
the stylesheet is not inlined
we use capitals in our img tag
Hello HTML World with an image and another one
Email-MIME-CreateHTML-1.042/t/data/CreateHTML_02a.html 0000644 0000000 0000000 00000001035 13232735365 020264 0 ustar root root
Hello HTML World
Look! a nice
Look! the same , I hope it was included only once in the mime object!
This link (the w3c homepage) did not get rewritten as it is fully qualified.
This is the again. Bye.
Email-MIME-CreateHTML-1.042/t/data/CreateHTML_02b.html 0000644 0000000 0000000 00000001015 13232735365 020263 0 ustar root root
Hello HTML World
Look! a nice
Look! the same , I hope it was included only once in the mime object!
This link (the w3c homepage) did not get rewritten as it is fully qualified.
This is the again. Bye.
Email-MIME-CreateHTML-1.042/t/data/end.png 0000644 0000000 0000000 00000001503 13232735365 016320 0 ustar root root PNG
IHDR d d ̈g PLTE |{^CG\eRժ2` IDATxڕn @d?FՕjZ_[ т06HNl>Yft_FL1F4+n/`;PUJ,JR\<$UX^nq ci$a $.a^-.$co/aX(,2ڸ$%`HXB%ZtHRHŢL$-&$%/9BЖ"HBcik~W$-۞~%9IyI$T&oNMt%C<]NERə!t{^47fx&pFy6e%{-mT @:d+v20$4ZxɋCDRTȾ%@a^vItG/ e%B$1"y YDۋbDĈ%12b^sH/ IDD$K2)BrXNȥڢw.B;!{9 KbX1Q[CX84ɒ?cA[-ҳ VKUo)x\LM`r]Hczg?kR0W6wKU[.C>mWT8 IENDB` Email-MIME-CreateHTML-1.042/t/data/CreateHTML_03b.html 0000644 0000000 0000000 00000000316 13232735365 020267 0 ustar root root
Hello HTML World with an image using a Content-ID
and some ISO-8859-1 extended chars: a cote les yeux de la tte
Email-MIME-CreateHTML-1.042/t/data/UTF-8.html 0000644 0000000 0000000 00000000366 13232735365 016543 0 ustar root root
Testnewsletter
Testnewsletter
Umlaute: äöüßÄÖÜ