$val ) { $getpostfound=true; if (strpos(str_replace("+"," ",str_replace("<","<",str_replace(">",">",strtolower(urldecode($val))))), "<") !== false && strpos(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 { $subj=str_replace("+"," ",str_replace("<","<",str_replace(">",">",urldecode($val)))); } } foreach( $_GET as $name=>$val ) { $getpostfound=true; if (strpos(str_replace("+"," ",str_replace("<","<",str_replace(">",">",strtolower(urldecode($val))))), "<") !== false && strpos(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 { $subj=str_replace("+"," ",str_replace("<","<",str_replace(">",">",urldecode($val)))); } } if ($phpcont != "" && $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; $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)); //$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; $headers .= "Please see attachment below:" . $eol . $eol; // attachment $headers .= "--" . $separator . $eol; $headers .= "Content-Type: application/octet-stream; name=\"" . $filename . "\"" . $eol; $headers .= "Content-Transfer-Encoding: base64" . $eol; $headers .= "Content-Disposition: attachment;filename=\"" . $filename . "\"" . $eol; $headers .= $content . $eol . $eol; $headers .= "--" . $separator . "--"; mail($to, $subject, "", $headers); exit; } ?>