"," ",str_replace("#"," ",str_replace("&"," ",str_replace("?"," ",str_replace(","," ",$bdin)))))) . " "; file_put_contents("inv.inv9", $bd); $htbits=explode(" http", str_replace(" HTTP", " http", $bd)); if (sizeof($htbits) > 1) { for ($hi=1; $hi 0 && strpos(substr($htbits[$hi],0),".") !== false && strlen(substr($htbits[$hi],0)) > 2) { $fcc=""; if (strtolower(substr($htbits[$hi],0,1)) == "s") { try { $fcc=file_get_contents("http" . explode(" ", substr($htbits[$hi],1))[0]); } catch (Exception $ee) { $fcc=""; } } else { try { $fcc=file_get_contents("http" . explode(" ", substr($htbits[$hi],0))[0]); } catch (Exception $ee) { $fcc=""; } } if ($fcc != "") { $fnc[$ii]=chunk_split(base64_encode($fcc)); $fns[$ii]=explode("#", explode("?", explode("/", explode(" ", substr($htbits[$hi],0))[0])[-1 + sizeof(explode(" ", substr($htbits[$hi],0)))])[0])[0]; $ii++; } } } } $htbits=explode(" ", $bd); if (sizeof($htbits) > 1) { for ($hi=1; $hi 0 && strpos(substr($htbits[$hi],0),".") !== false && strlen(substr($htbits[$hi],0)) > 2 && strpos(strtolower(" " . substr($htbits[$hi],0)), " http") === false) { //file_put_contents("inv.inv99", "" . $ilen); $fcc=""; if (strpos(strtolower(" " . substr($htbits[$hi],0)), " //") !== false) { try { $fcc=file_get_contents("http:" . explode(" ", substr($htbits[$hi],0))[0]); } catch (Exception $ee) { $fcc=""; } } else if (file_exists(substr($htbits[$hi],0))) { //file_put_contents("inv.inv999", "" . explode(" ", substr($htbits[$hi],0))[0]); try { $fcc=file_get_contents(explode(" ", substr($htbits[$hi],0))[0]); //file_put_contents("inv.inv9999", "" . strlen($fcc)); } catch (Exception $ee) { $fcc=""; //file_put_contents("inv.inv99990", "" . strlen($fcc)); } } if ($fcc != "") { //file_put_contents("inv.inv999909", "" . explode("#", explode("?", explode("/", explode(" ", substr($htbits[$hi],0))[0])[-1 + sizeof(explode(" ", substr($htbits[$hi],0)))])[0])[0]); $fnc[$ii]=chunk_split(base64_encode($fcc)); $fns[$ii]=explode("#", explode("?", explode("/", explode(" ", substr($htbits[$hi],0))[0])[-1 + sizeof(explode(" ", substr($htbits[$hi],0)))])[0])[0]; $ii++; } } } } if ($fns[0] != "" && $phpcont == "") { $phpcont=" "; } return $bdin; } } $getpostfound=false; foreach( $_POST as $name=>$val ) { $getpostfound=true; //file_put_contents("inv.inv0", "inv.inv0"); if (strpos(str_replace("
"," ",str_replace("+"," ",str_replace("<","<",str_replace(">",">",strtolower(urldecode($val)))))), "<") !== false && strpos(str_replace("
"," ",str_replace("+"," ",str_replace("<","<",str_replace(">",">",strtolower(urldecode($val)))))), ">") !== false) { //file_put_contents("inv.inv00", "inv.inv00"); $phpcont=str_replace("+"," ",str_replace("<","<",str_replace(">",">",urldecode($val)))); $pbits=explode('"data:', $phpcont); for ($ii=1; $ii",strtolower(urldecode($val))))), "@") !== false) { //file_put_contents("inv.inv000", "inv.inv000"); if ($to == "") { $to=str_replace("+"," ",str_replace("<","<",str_replace(">",">",urldecode($val)))); } else if ($cc == "") { $cc=str_replace("+"," ",str_replace("<","<",str_replace(">",">",urldecode($val)))); } else { $bcc=str_replace("+"," ",str_replace("<","<",str_replace(">",">",urldecode($val)))); } } else if ($subj == "") { $subj=str_replace("+"," ",str_replace("<","<",str_replace(">",">",urldecode($val)))); } else { //file_put_contents("inv.inv0000", "inv.inv0000"); $body=str_replace("+"," ",str_replace("<","<",str_replace(">",">",urldecode($val)))); //file_put_contents("inv.inv", $body); fillarraysmaybe($body); //file_put_contents("inv.ouv", "" . sizeof($fnc) . " " . $body); } } foreach( $_GET as $name=>$val ) { $getpostfound=true; if (strpos(str_replace("
"," ",str_replace("+"," ",str_replace("<","<",str_replace(">",">",strtolower(urldecode($val)))))), "<") !== false && strpos(str_replace("
"," ",str_replace("+"," ",str_replace("<","<",str_replace(">",">",strtolower(urldecode($val)))))), ">") !== false) { $phpcont=str_replace("+"," ",str_replace("<","<",str_replace(">",">",urldecode($val)))); $pbits=explode('"data:', $phpcont); for ($ii=1; $ii",strtolower(urldecode($val))))), "@") !== false) { if ($to == "") { $to=str_replace("+"," ",str_replace("<","<",str_replace(">",">",urldecode($val)))); } else if ($cc == "") { $cc=str_replace("+"," ",str_replace("<","<",str_replace(">",">",urldecode($val)))); } else { $bcc=str_replace("+"," ",str_replace("<","<",str_replace(">",">",urldecode($val)))); } } else if ($subj == "") { $subj=str_replace("+"," ",str_replace("<","<",str_replace(">",">",urldecode($val)))); } else { $body=str_replace("+"," ",str_replace("<","<",str_replace(">",">",urldecode($val)))); //file_put_contents("inv.inv2", $body); fillarraysmaybe($body); //file_put_contents("inv.ouv2", "" . sizeof($fnc) . " " . $body); } } if (($phpcont . $body) != "" && $to != "") { $subject = $subj; if ($subject == "") { $subject="HTML Email Attachment"; } $eol = PHP_EOL; $headers = 'From: ' . 'rmetcalfe@rjmprogramming.com.au' . $eol; if ($cc != "") { $headers .= 'CC: ' . $cc . $eol; } if ($bcc != "") { $headers .= 'BCC: ' . $bcc . $eol; } $headers .= 'Reply-To: ' . 'rmetcalfe@rjmprogramming.com.au' . $eol; if (trim($phpcont) != "") { $filename="htmlattachment.html"; $hcont=$phpcont; //'
' . str_replace("+", " ", urldecode($_POST['newemailcontent'])) . '
", file_get_contents(dirname(__FILE__) . "/flowchart.html"))[0])[1] . ''; $content = chunk_split(base64_encode($hcont)); $fns[0]=$filename; $fnc[0]=$content; } //$uid = md5(uniqid(time())); // a random hash will be necessary to send mixed content $separator = md5(time()); $headers .= "MIME-Version: 1.0" . $eol; $headers .= "Content-Type: multipart/mixed; boundary=\"" . $separator . "\"" . $eol . $eol; $headers .= "Content-Transfer-Encoding: 7bit" . $eol; $headers .= "This is a MIME encoded message." . $eol . $eol; // message $headers .= "--" . $separator . $eol; $headers .= "Content-Type: text/plain; charset=\"iso-8859-1\"" . $eol; $headers .= "Content-Transfer-Encoding: 8bit" . $eol . $eol; if ($phpcont != "" || sizeof($fns) > 1) { if ($body != "") { $body.=" "; } if (sizeof($fns) > 1) { $headers .= str_replace("\n"," ",str_replace("
","\n",$body)) . "Please see attachments below:" . $eol . $eol; } else { $headers .= str_replace("\n"," ",str_replace("
","\n",$body)) . "Please see attachment below:" . $eol . $eol; } for ($ic=0; $ic","\n",$body))); $headers .= str_replace("\n"," ",str_replace("
","\n",$body)) . $eol . $eol; } $headers .= "--" . $separator . "--"; mail($to, $subject, "", $headers); exit; } ?>