|
Lines 63-68
runreport.pl [ -h | -m ] [ -v ] reportID [ reportID ... ]
Link Here
|
| 63 |
--method method is the type of authentication. Ie. LOGIN, DIGEST-MD5, etc. |
63 |
--method method is the type of authentication. Ie. LOGIN, DIGEST-MD5, etc. |
| 64 |
--to=s e-mail address to send report to |
64 |
--to=s e-mail address to send report to |
| 65 |
--from=s e-mail address to send report from |
65 |
--from=s e-mail address to send report from |
|
|
66 |
--test-email report email to command line, do not send |
| 66 |
--subject=s subject for the e-mail |
67 |
--subject=s subject for the e-mail |
| 67 |
--param=s parameters for the report |
68 |
--param=s parameters for the report |
| 68 |
--store-results store the result of the report |
69 |
--store-results store the result of the report |
|
Lines 107-112
Empty string is allowed.
Link Here
|
| 107 |
|
108 |
|
| 108 |
Whether to use e-mail (implied by --to or --from). |
109 |
Whether to use e-mail (implied by --to or --from). |
| 109 |
|
110 |
|
|
|
111 |
=item B<--test-email> |
| 112 |
|
| 113 |
Whether to only report the email, rather than sending. |
| 114 |
|
| 110 |
=item B<--attachment> |
115 |
=item B<--attachment> |
| 111 |
|
116 |
|
| 112 |
Whether to include the results as an attachment (requires --email|--to|--from) |
117 |
Whether to include the results as an attachment (requires --email|--to|--from) |
|
Lines 195-200
my $help = 0;
Link Here
|
| 195 |
my $man = 0; |
200 |
my $man = 0; |
| 196 |
my $verbose = 0; |
201 |
my $verbose = 0; |
| 197 |
my $send_email = 0; |
202 |
my $send_email = 0; |
|
|
203 |
my $test_email = 0; |
| 198 |
my $send_empty = 0; |
204 |
my $send_empty = 0; |
| 199 |
my $attachment = 0; |
205 |
my $attachment = 0; |
| 200 |
my $attach_only = 0; |
206 |
my $attach_only = 0; |
|
Lines 228-233
GetOptions(
Link Here
|
| 228 |
'subject=s' => \$subject, |
234 |
'subject=s' => \$subject, |
| 229 |
'param=s' => \@params, |
235 |
'param=s' => \@params, |
| 230 |
'email' => \$send_email, |
236 |
'email' => \$send_email, |
|
|
237 |
'test-email' => \$test_email, |
| 231 |
'send_empty' => \$send_empty, |
238 |
'send_empty' => \$send_empty, |
| 232 |
'a|attachment' => \$attachment, |
239 |
'a|attachment' => \$attachment, |
| 233 |
'ao|attach_only' => \$attach_only, |
240 |
'ao|attach_only' => \$attach_only, |
|
Lines 250-255
unless ($format) {
Link Here
|
| 250 |
} |
257 |
} |
| 251 |
|
258 |
|
| 252 |
$attachment = 1 if $attach_only; |
259 |
$attachment = 1 if $attach_only; |
|
|
260 |
$send_email = 1 if $test_email; |
| 253 |
|
261 |
|
| 254 |
if ($csv_separator) { |
262 |
if ($csv_separator) { |
| 255 |
if ( $format eq 'csv' ) { |
263 |
if ( $format eq 'csv' ) { |
|
Lines 405-416
foreach my $report_id (@ARGV) {
Link Here
|
| 405 |
if $username; |
413 |
if $username; |
| 406 |
|
414 |
|
| 407 |
$email->transport( $smtp_server->transport ); |
415 |
$email->transport( $smtp_server->transport ); |
| 408 |
try { |
416 |
|
| 409 |
$email->send_or_die; |
417 |
if( $test_email ){ |
|
|
418 |
warn Data::Dumper::Dumper( $email ); |
| 419 |
} else { |
| 420 |
try { |
| 421 |
$email->send_or_die; |
| 422 |
} |
| 423 |
catch { |
| 424 |
carp "Mail not sent: $_"; |
| 425 |
}; |
| 410 |
} |
426 |
} |
| 411 |
catch { |
|
|
| 412 |
carp "Mail not sent: $_"; |
| 413 |
}; |
| 414 |
} |
427 |
} |
| 415 |
else { |
428 |
else { |
| 416 |
print $message; |
429 |
print $message; |
| 417 |
- |
|
|