예제 #1
0
function enviarEmail($nombreRemitente, $emailRemitente, $emailDestinatario, $asunto, $mensaje, $tipoEmail = "text/plain")
{
    return smtp($emailRemitente, $nombreRemitente, $emailDestinatario, $emailDestinatario, $asunto, $mensaje, $tipoEmail);
}
function do_send($to_str, $subject_str, $text_str)
{
    // 7/7/09
    global $istest;
    $sleep = 4;
    // seconds delay between text messages
    function stripLabels($sText)
    {
        $labels = array("Incident:", "Priority:", "Nature:", "Addr:", "Descr:", "Reported by:", "Phone:", "Written:", "Updated:", "Status:", "Disp:", "Run Start:", "Map:", get_text("Patient") . ":", "Actions:", "Tickets host:");
        // 5/9/10
        for ($x = 0; $x < count($labels); $x++) {
            $sText = str_replace($labels[$x], '', $sText);
        }
        return $sText;
    }
    $to_array = explode("|", $to_str);
    // pipe-delimited string  - 10/17/08
    require_once "cell_addrs.inc.php";
    // 10/22/08
    $cell_addrs = array("vtext.com", "messaging.sprintpcs.com", "txt.att.net", "vmobl.com", "myboostmobile.com");
    // 10/5/08
    if ($istest) {
        array_push($cell_addrs, "gmail.com");
    }
    $host = get_variable('host');
    $temp = get_variable('email_reply_to');
    //	$reply_to = (empty($temp))? "": "'Reply-To: '". $temp ."\r\n" ;
    $reply_to = empty($temp) ? "" : "'Reply-To: " . $temp . "'\r\n";
    // 2/18/10
    $temp = get_variable('email_from');
    // 6/24/09
    if (empty($temp)) {
        $from_str = "Tickets_CAD" . '@' . $host;
    } else {
        $temp_ar = explode("@", $temp);
        if (count($temp_ar) == 2) {
            $from_str = $temp;
            // OK
        } else {
            $from_str = $temp_ar[0] . "@" . $host;
        }
    }
    //	$from = (empty($temp))?  "Tickets_CAD" : $temp;
    $headers = 'From:' . $from_str . "\r\n" . $reply_to . 'X-Mailer: PHP/' . phpversion();
    $to_sep = $cell_sep = "";
    $tostr = $tocellstr = "";
    for ($i = 0; $i < count($to_array); $i++) {
        $temp = explode("@", $to_array[$i]);
        if (in_array(trim(strtolower($temp[1])), $cell_addrs)) {
            // cell addr?
            $tocellstr .= $cell_sep . stripslashes($to_array[$i]);
            // yes
            $cell_sep = ",";
        } else {
            // no
            $tostr .= $to_sep . stripslashes($to_array[$i]);
            $to_sep = ",";
            // comma separated addr string
        }
    }
    // end for ($i = ...)
    $caption = "";
    $smtp = trim(get_variable('smtp_acct'));
    // 7/7/09
    if (strlen($tostr) > 0) {
        if (strlen($smtp) == 0) {
            @mail($tostr, $subject_str, $text_str, $headers);
        } else {
            smtp($tostr, $subject_str, $text_str, $smtp, $from_str);
            // ($my_to, $my_subject, $my_message, $my_params)
        }
        $caption = "Email sent";
    }
    if (strlen($tocellstr) > 0) {
        $lgth = 140;
        $ix = 0;
        $i = 1;
        $cell_text_str = stripLabels($text_str);
        // strip labels 5/10/10
        while (substr($cell_text_str, $ix, $lgth)) {
            // chunk to $lgth-length strings
            $subject_ex = $subject_str . "/part " . $i . "/";
            // 10/21/08
            if (strlen($smtp) == 0) {
                mail($tocellstr, $subject_ex, substr($cell_text_str, $ix, $lgth), $headers);
            } else {
                smtp($tocellstr, $subject_ex, substr($cell_text_str, $ix, $lgth), $smtp, $from_str);
                // ($my_to, $my_subject, $my_message, $my_params, $my_from)
            }
            if ($i > 1) {
                sleep($sleep);
            }
            // 10/17/08
            $ix += $lgth;
            $i++;
        }
        $caption .= " - Cell mail sent";
    }
    return $caption;
}
예제 #3
0
	include_once('ressources/class.users.menus.inc');
	include_once('ressources/class.maincf.multi.inc');
	
	
$users=new usersMenus();
if(!PostFixVerifyRights()){
	$tpl=new templates();
	$ERROR_NO_PRIVS=$tpl->javascript_parse_text("{ERROR_NO_PRIVS}");
	echo "alert('$ERROR_NO_PRIVS');";
	die();
	
}


	if(isset($_GET["popup"])){popup();exit;}
	if(isset($_GET["smtp"])){smtp();exit;}
	if(isset($_GET["smtp-instance-list"])){smtp_instance_list();exit;}
	if(isset($_GET["smtp-instance-add"])){smtp_instance_add();exit;}
	if(isset($_GET["smtp-instance-delete"])){smtp_instance_delete();exit;}
	if(isset($_GET["smtp-instance-edit"])){smtp_instance_edit();exit;}
	if(isset($_GET["smtp-instance-save"])){smtp_instance_save();exit;}
	
	if(isset($_GET["domains"])){domains_popup();exit;}
	if(isset($_GET["domains-add"])){domains_add();exit;}
	if(isset($_GET["domains-list"])){domains_list();exit;}
	if(isset($_GET["domain-delete"])){domains_delete();exit;}

	js();


예제 #4
0
include_once 'ressources/class.templates.inc';
include_once 'ressources/class.users.menus.inc';
include_once 'ressources/class.maincf.multi.inc';
$users = new usersMenus();
if (!PostFixVerifyRights()) {
    $tpl = new templates();
    $ERROR_NO_PRIVS = $tpl->javascript_parse_text("{ERROR_NO_PRIVS}");
    echo "alert('{$ERROR_NO_PRIVS}');";
    die;
}
if (isset($_GET["popup"])) {
    popup();
    exit;
}
if (isset($_GET["smtp"])) {
    smtp();
    exit;
}
if (isset($_GET["smtp-instance-tab"])) {
    smtp_instance_tab();
    exit;
}
if (isset($_GET["smtp-instance-list"])) {
    smtp_instance_list();
    exit;
}
if (isset($_GET["smtp-instance-add"])) {
    smtp_instance_add();
    exit;
}
if (isset($_GET["smtp-instance-delete"])) {