diff --git a/lib/emailreports.pm b/lib/emailreports.pm
index 7c03d8a..c313ae7 100644
--- a/lib/emailreports.pm
+++ b/lib/emailreports.pm
@@ -32,6 +32,7 @@ sub emailreports_send {
my $myself = (caller(0))[3];
my ($config, $report, $when, $debug) = @_;
my $emailreports = $config->{emailreports};
+ my $imgfmt_lc = lc($config->{image_format});
my $base_cgi = $config->{base_cgi};
my $imgs_dir = $config->{imgs_dir};
@@ -131,14 +132,12 @@ EOF
$n = 1;
foreach (split('\n', $graph)) {
if(/");
- $images->{"image_$g$n"} = "";
-
+ push(@tmp, "");
($url) = $_ =~ m/new($url);
my $path = $uri->path || "";
$response = $ua->request(HTTP::Request->new('GET', "$prefix$path"));
- $images->{"image_$g$e$n"} = $response->content;
+ $images->{"image_$g$e$n.$imgfmt_lc"} = $response->content;
$n++;
} else {
push(@tmp, $_);
@@ -199,7 +198,7 @@ EOF
);
while (my ($key, $val) = each(%{$images})) {
$msg->attach(
- Type => $mime,
+ Type => "$mime; name=\"$key\"",
Id => $key,
Data => $val,
);