Lines 241-254
foreach my $report_id (@ARGV) {
Link Here
|
241 |
$message .= $csv->string() . "\n"; |
241 |
$message .= $csv->string() . "\n"; |
242 |
} |
242 |
} |
243 |
} |
243 |
} |
244 |
|
|
|
245 |
if ($email){ |
244 |
if ($email){ |
246 |
my %mail = ( |
245 |
my %mail; |
247 |
To => $to, |
246 |
if ($format eq 'html') { |
248 |
From => $from, |
247 |
$message = "<html><head><style>tr:nth-child(n+1) { background-color: #ccc;}</style></head><body>$message</body></html>"; |
249 |
Subject => encode('utf8', $subject ), |
248 |
%mail = ( |
250 |
Message => encode('utf8', $message ) |
249 |
To => $to, |
251 |
); |
250 |
From => $from, |
|
|
251 |
'Content-Type' => 'text/html', |
252 |
Subject => encode('utf8', $subject ), |
253 |
Message => encode('utf8', $message ) |
254 |
); |
255 |
} else { |
256 |
%mail = ( |
257 |
To => $to, |
258 |
From => $from, |
259 |
Subject => encode('utf8', $subject ), |
260 |
Message => encode('utf8', $message ) |
261 |
); |
262 |
} |
252 |
sendmail(%mail) or carp 'mail not sent:' . $Mail::Sendmail::error; |
263 |
sendmail(%mail) or carp 'mail not sent:' . $Mail::Sendmail::error; |
253 |
} else { |
264 |
} else { |
254 |
print $message; |
265 |
print $message; |
255 |
- |
|
|