Mailversand bei Finanzerfassung
This commit is contained in:
@ -1,5 +1,4 @@
|
||||
<?php
|
||||
error_reporting(E_ALL);
|
||||
require_once("../config.inc.php");
|
||||
#require('../phpmailer/class.phpmailer.php');
|
||||
|
||||
@ -66,44 +65,6 @@ for ($i = 0; $i < sizeof($empfaenger); $i++) {
|
||||
$mail_bcc = array_unique($mail_bcc);
|
||||
|
||||
|
||||
function save_mail($mail)
|
||||
{
|
||||
// Mails in IMAP Gesendete schieben
|
||||
#####################################################
|
||||
## Wegen dieser Funktion, wurde PHP Version aktiviert. Siehe ../Hinweise_zu_php8.txt
|
||||
#####################################################
|
||||
|
||||
|
||||
// # Script um sich $path anzeigen zu lassen:
|
||||
// $mbox = imap_open("{imap.ionos.de:993/imap/ssl}", "$mailjumi", "$mailpwd", OP_HALFOPEN)
|
||||
// or die("can't connect: " . imap_last_error());
|
||||
// if($mbox){
|
||||
// echo "connect";
|
||||
// }else{
|
||||
// echo "fail";
|
||||
// }
|
||||
// $list = imap_getmailboxes($mbox, "{imap.ionos.de:993/imap/ssl}", "*");
|
||||
// if (is_array($list)) {
|
||||
// foreach ($list as $key => $val) {
|
||||
// echo "($key) ";
|
||||
// echo imap_utf7_decode($val->name) . ",";
|
||||
// echo "'" . $val->delimiter . "',";
|
||||
// echo $val->attributes . "<br />\n";
|
||||
// }
|
||||
// } else {
|
||||
// echo "imap_getmailboxes failed: " . imap_last_error() . "\n";
|
||||
// }
|
||||
//
|
||||
// imap_close($mbox);
|
||||
|
||||
$path = "{imap.ionos.de:993/imap/ssl}Gesendete Objekte";
|
||||
$imapStream = imap_open($path, $mail->Username, $mail->Password);
|
||||
# Letzter Flag Seen, damit die Mail bereits als gelesen in gesendete Objekte eingestellt wird
|
||||
$result = imap_append($imapStream, $path, $mail->getSentMIMEMessage(),"\Seen");
|
||||
imap_close($imapStream);
|
||||
return true;
|
||||
}
|
||||
|
||||
$mail = new PHPMailer();
|
||||
|
||||
try {
|
||||
@ -148,9 +109,9 @@ try {
|
||||
//$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
|
||||
|
||||
$mail->send();
|
||||
if (save_mail($mail)) {
|
||||
#echo "Message saved!";
|
||||
}
|
||||
require_once("../controller/func_save_mail.php");
|
||||
save_mail($mail);
|
||||
|
||||
echo '<div class="alert alert-success"><i class="fa fa-fw fa-thumbs-up"></i> Mail wurde versendet!</div>|***|success';
|
||||
}
|
||||
catch (Exception $e) {
|
||||
|
Reference in New Issue
Block a user