View | Details | Raw Unified | Return to bug 15133
Collapse All | Expand All

(-)a/misc/cronjobs/runreport.pl (-20 / +6 lines)
Lines 273-299 foreach my $report_id (@ARGV) { Link Here
273
        }
273
        }
274
    }
274
    }
275
    if ($email){
275
    if ($email){
276
        my $email = Koha::Email->new();
276
        my $args = { to => $to, from => $from, subject => $subject };
277
        my %mail;
278
        if ($format eq 'html') {
277
        if ($format eq 'html') {
279
                $message = "<html><head><style>tr:nth-child(2n+1) { background-color: #ccc;}</style></head><body>$message</body></html>";
278
            $message = "<html><head><style>tr:nth-child(2n+1) { background-color: #ccc;}</style></head><body>$message</body></html>";
280
           %mail = $email->create_message_headers({
279
            $args->{contenttype} = 'text/html';
281
              to      => $to,
282
              from    => $from,
283
              contenttype => 'text/html',
284
              subject => encode('utf8', $subject ),
285
              message => encode('utf8', $message )
286
           }
287
          );
288
        } else {
289
          %mail = $email->create_message_headers ({
290
              to      => $to,
291
              from    => $from,
292
              subject => encode('utf8', $subject ),
293
              message => encode('utf8', $message )
294
          }
295
          );
296
        }
280
        }
281
        $args->{message} = $message;
282
        my $email = Koha::Email->new();
283
        my %mail = $email->create_message_headers($args);
297
        $mail{'Auth'} = {user => $username, pass => $password, method => $method} if $username;
284
        $mail{'Auth'} = {user => $username, pass => $password, method => $method} if $username;
298
        sendmail(%mail) or carp 'mail not sent:' . $Mail::Sendmail::error;
285
        sendmail(%mail) or carp 'mail not sent:' . $Mail::Sendmail::error;
299
    } else {
286
    } else {
300
- 

Return to bug 15133