Ejemplo n.º 1
0
$disp_str = "";
if ($row[8] == "1") {
    header('Content-Type: text/html; charset=' . $charset_encoding);
} else {
    header('Content-Type: text/plain; charset=' . $charset_encoding);
}
if (!isset($_REQUEST['e_id'])) {
    $content = str_replace("{UNSUBSCRIBE-LINK}", "preview_unsub.php", $row[5]);
    if ($enable_web_page_preview == 1) {
        if ($row[8] == "1") {
            $disp_str .= "Email not displaying correctly ? <a href=\"#\">View it in your browser</a><br>";
        }
    }
} else {
    if ($enable_web_page_preview == 1) {
        $content = replaceExtraParams($mysql, $table_prefix, "{$defaultname}", $content, $e_id);
    }
    $content = str_replace("{UNSUBSCRIBE-LINK}", "#", $content);
}
if ($row[16] != 0) {
    $final_str = $mysql->echo_one("select content from " . $table_prefix . "email_template where id='{$row['16']}'");
    $final_str = str_replace("{CONTENT}", $content, $final_str);
} else {
    $final_str = $content;
}
$final_str = $disp_str . $final_str;
echo $final_str;
function replaceExtraParams($mysql, $table_prefix, $defaultname, $input, $emailid)
{
    //echo "<br>,$table_prefix,$defaultname,$input,$emailid <br>";
    //	if($mysql->total("".$table_prefix."ea_extraparam","name='name' and eid=$emailid")!=0)
Ejemplo n.º 2
0
        $mail->FromName = $row[6];
        //$mail->Sender =$error_ret_mail;
        $mail->AddAddress($Recipiant);
        $mail->AddReplyTo($mail->From, $mail->FromName);
        //$mail->WordWrap = 50; //optional, you can delete this line
        if ($row[8] == "1") {
            $mail->IsHTML(true);
        }
        //set email format to HTML
        $mail->Subject = $Subject;
        $mail->Body = $final_str;
        //html body
        $alt_content = $row[17];
        $alt_content = str_replace("{UNSUBSCRIBE-LINK}", "#", $alt_content);
        $alt_content = str_replace("{EMAIL}", $toemail, $alt_content);
        $alt_content = replaceExtraParams($mysql, $table_prefix, "{$defaultname}", $alt_content);
        $mail->AltBody = $alt_content;
        //$mail->AltBody = $content;  //plain text body
    }
}
$attres = mysql_query("select * from " . $table_prefix . "ea_attachments where cid={$row['0']}");
while ($at = mysql_fetch_row($attres)) {
    //$filename = "attachments/$at[1]/$at[2]";
    $pathToServerFile = "attachments/{$at['1']}/{$at['2']}";
    //** attach this very PHP script.
    $serverFileMimeType = 'application/octet-stream';
    //** this PHP file is plain text.
    //** attach the given file to be sent with this message. ANy number of
    //** attachments can be associated with an email message.
    //** NOTE: If the file path does not exist or cannot be read by PHP the file
    //** will not be sent with the email message.