Verteilerlisten, Mailsystem
This commit is contained in:
@ -41,6 +41,19 @@ for ($i = 0; $i < sizeof($empfaenger); $i++) {
|
||||
array_push($mail_bcc, "$row1[mail]");
|
||||
}
|
||||
}
|
||||
|
||||
if ($trenner[0] == 'V') {
|
||||
$query2 = "select mail
|
||||
from jumi_mailverteiler a, jumi_mailverteiler_entries b
|
||||
where a.mvid=b.mvid
|
||||
and b.mvid=$trenner[1]";
|
||||
|
||||
$result2 = $db->query($query2) or die("Cannot execute query");
|
||||
|
||||
while ($row2 = $result2->fetch_array()) {
|
||||
array_push($mail_bcc, "$row2[mail]");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -56,29 +69,28 @@ function save_mail($mail)
|
||||
## Wegen dieser Funktion, wurde PHP Version aktiviert. Siehe ../Hinweise_zu_php8.txt
|
||||
#####################################################
|
||||
|
||||
/*
|
||||
# Scritp um sich $path anzeigen zu lassen:
|
||||
$mbox = imap_open("{imap.ionos.de:993/imap/ssl}", "info@ju-and-mi.de", "passwort", 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);
|
||||
*/
|
||||
|
||||
// # Script um sich $path anzeigen zu lassen:
|
||||
// $mbox = imap_open("{imap.ionos.de:993/imap/ssl}", "info@ju-and-mi.de", "passwort", 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);
|
||||
@ -110,7 +122,7 @@ try {
|
||||
//$mail->SetFrom($_POST["userEmail"], $_POST["userName"]);
|
||||
//$mail->AddReplyTo($_POST["userEmail"], $_POST["userName"]);
|
||||
$mail->SetFrom("info@ju-and-mi.de", "Info JU & MI");
|
||||
$mail->AddAddress("info@ju-and-mi.de", "Info JU & MI");
|
||||
# $mail->AddAddress("info@ju-and-mi.de", "Info JU & MI");
|
||||
$mail->AddReplyTo("info@ju-and-mi.de", "Info JU & MI");
|
||||
//$mail->addCC('cc@example.com');
|
||||
foreach ($mail_bcc as $empfbcc) {
|
||||
@ -135,10 +147,10 @@ try {
|
||||
if (save_mail($mail)) {
|
||||
#echo "Message saved!";
|
||||
}
|
||||
echo "<p class='success'>Mail Sent Successfully.</p>";
|
||||
echo '<div class="alert alert-success"><i class="fa fa-fw fa-thumbs-up"></i> Mail wurde versendet!</div>|***|success';
|
||||
}
|
||||
catch (Exception $e) {
|
||||
echo "<p class='error'>Message could not be sent. Mailer Error: {$mail->ErrorInfo}</p>";
|
||||
echo "<div class='alert alert-danger'><i class='fa fa-fw fa-thumbs-down'></i> Es konnte <b>keine Mail</b> verschickt werden! Mailer Error: {$mail->ErrorInfo}</div>|***|error";
|
||||
}
|
||||
|
||||
?>
|
Reference in New Issue
Block a user