Example #1
0
function saveMailTpl($sub, $txt, $mid = 0)
{
    $rc = saveMailVorlage(array("Subject" => $sub, "BodyText" => $txt, "MID" => $mid));
    if ($rc) {
        echo json_encode(array('rc' => $rc));
    } else {
        echo json_encode(array('rc' => ''));
    }
}
Example #2
0
                $hide = "visible";
            }
        } else {
            $referer = $_SESSION['baseurl'] . '/crm/mail.php';
            $btn = '<a href="mail.php"><image src="image/new.png" alt=".:new:." title=".:new:." border="0" ></a>';
            $hide = "visible";
        }
        $referer .= "&popup=" . $_POST['popup'];
    } else {
        $referer = '';
        $btn = '<a href="mail.php"><image src="image/new.png" alt=".:new:." title=".:new:." border="0" ></a>';
        $hide = "visible";
    }
}
if ($_POST["aktion"] == "tplsave") {
    $rc = saveMailVorlage($_POST);
} else {
    if ($_POST["aktion"] == "sendmail") {
        $okT = true;
        $okC = true;
        $okA = true;
        $msg = "";
        if ($_POST["TO"]) {
            $TO = preg_replace("/[^a-z0-9 !?:;,.\\/_\\-=+@#\$&\\*\\(\\)<>]/im", "", $_POST["TO"]);
            $rc = chkMailAdr($TO);
            if ($rc != "ok") {
                $okT = false;
                $msg = "TO:" . $rc;
            }
        }
        if ($_POST["CC"]) {