X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/timetracker.git/blobdiff_plain/3ad790a3d4bc23cb23f7ee072171ca6ef987eb56..30470a2fe679c83c29259328c5ad60a32ce69d3d:/invoice_send.php diff --git a/invoice_send.php b/invoice_send.php index b9e2a293..bc290a66 100644 --- a/invoice_send.php +++ b/invoice_send.php @@ -86,7 +86,7 @@ if ($request->isPost()) { $mailer->setReceiver($cl_receiver); if (isset($cl_cc)) $mailer->setReceiverCC($cl_cc); - $mailer->setSendType(MAIL_MODE); + $mailer->setMailMode(MAIL_MODE); if ($mailer->send($cl_subject, $body)) $msg->add($i18n->getKey('form.mail.invoice_sent')); else @@ -94,6 +94,16 @@ if ($request->isPost()) { } } // isPost +$smarty->assign('sender', SENDER); +if (function_exists('imap_mime_header_decode')) { + // Decode sender in case it is encoded. PHP IMAP extension must be installed for us to get here. + $elements = imap_mime_header_decode(SENDER); + if (count($elements) > 1) { + // Reassign sender. + $smarty->assign('sender', $elements[count($elements) - 2]->text); + } +} + $smarty->assign('title', $i18n->getKey('title.send_invoice')); $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('onload', 'onLoad="document.mailForm.'.($cl_receiver?'comment':'receiver').'.focus()"');