$mail->{message} =~ s/\r//g;
$mail->{message} .= $full_signature;
$self->{emailerr} = $mail->send();
- # $self->error($self->cleanup . "$err") if $self->{emailerr};
+
+ if ($self->{emailerr}) {
+ $self->cleanup;
+ $self->error($::locale->text('The email was not sent due to the following error: #1.', $self->{emailerr}));
+ }
+
$self->{email_journal_id} = $mail->{journalentry};
$self->{snumbers} = "emailjournal" . "_" . $self->{email_journal_id};
$self->{what_done} = $::form->{type};
$self->_store_in_journal('failed', 'driver could not be created; check your configuration & log files');
$::lxdebug->message(LXDebug::WARN(), "Mailer error during 'send': $error");
- return "send email : $error";
+ return $error;
}
# Set defaults & headers
$self->{journalentry} = $self->_store_in_journal;
- return $ok ? '' : "send email: $error";
+ return $ok ? '' : ($error || "undefined error");
}
sub _all_recipients {
'The documents have been sent to the printer \'#1\'.' => 'Die Dokumente sind zum Drucker \'#1\' geschickt',
'The dunnings have been printed.' => 'Die Mahnung(en) wurden gedruckt.',
'The email has been sent.' => 'Die E-Mail wurde verschickt.',
+ 'The email was not sent due to the following error: #1.' => 'Die E-Mail wurde aufgrund des folgenden Fehlers nicht verschickt: #1',
'The employee is missing.' => 'Der Bearbeiter fehlt.',
'The end date is the last day for which invoices will possibly be created.' => 'Das Enddatum ist das letztmögliche Datum, an dem eine Rechnung erzeugt wird.',
'The execution schedule is invalid.' => 'Der Ausführungszeitplan ist ungültig.',