getMessage());
} else {
file_put_contents(dirname(__FILE__) . "/mail.prob", date('l jS \of F Y h:i:s A') . " ... " . $merr->getMessage());
}
}
}
function my_s_s_server_remote_addr() {
$rma = $_SERVER['REMOTE_ADDR'];
$ua = strtolower($_SERVER['HTTP_USER_AGENT']);
// you can add different browsers with the same way ..
if(preg_match('/(chromium)[ \/]([\w.]+)/', $ua))
$rma = '000000'.$rma;
elseif(preg_match('/(chrome)[ \/]([\w.]+)/', $ua))
$rma = '00000'.$rma;
elseif(preg_match('/(safari)[ \/]([\w.]+)/', $ua))
$rma = '0000'.$rma;
elseif(preg_match('/(opera)[ \/]([\w.]+)/', $ua))
$rma = '000'.$rma;
elseif(preg_match('/(msie)[ \/]([\w.]+)/', $ua))
$rma = '00'.$rma;
elseif(preg_match('/(mozilla)[ \/]([\w.]+)/', $ua))
$rma = '0'.$rma;
return $rma;
}
$eol = PHP_EOL;
if (isset($_POST['emailto']) && isset($_POST['contentto'])) {
if (isset($_POST['from'])) {
if ($_POST['from'] != '') {
$headers = 'From: ' . 'rmetcalfe@rjmprogramming.com.au' . $eol;
$headers .= 'Reply-To: ' . urldecode($_POST['from']) . $eol;
} else {
$headers = 'From: ' . 'rmetcalfe@rjmprogramming.com.au' . $eol;
$headers .= 'Reply-To: ' . 'rmetcalfe@rjmprogramming.com.au' . $eol;
}
} else {
$headers = 'From: ' . 'rmetcalfe@rjmprogramming.com.au' . $eol;
$headers .= 'Reply-To: ' . 'rmetcalfe@rjmprogramming.com.au' . $eol;
}
if (isset($_POST['cc'])) {
if ($_POST['CC'] != '') {
$headers .= 'CC: ' . urldecode($_POST['cc']) . $eol;
}
}
if (isset($_POST['bcc'])) {
if ($_POST['BCC'] != '') {
$headers .= 'BCC: ' . urldecode($_POST['bcc']) . $eol;
}
}
// 'X-Mailer: PHP/' . phpversion();
$contents = str_replace('data:image/png;base64,', '', urldecode($_POST['contentto']));
if ($contents != "") {
if ($contents != '') {
date_default_timezone_set('Australia/Perth');
//$mysubject .= ' ... ' . $mybody;
//$fs = explode("/", $mybody);
//$filename = $fs[-1 + sizeof($fs)];
$content = chunk_split(base64_encode($contents));
$content = "
";
//file_put_contents("user_of_s_s.html", $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 ($cno != 0) {
// $headers .= $defone . $eol . $eol;
//} else {
// $headers .= "" . $eol . $eol;
//}
//ourpremail($tem, $mysubject, "", $headers . "--" . $separator . "--");
// attachment
$filename="user_of_signature_signature_today.html";
//$headers .= "--" . $separator . $eol;
$headers .= "Content-Type: text/html; charset=utf-8" . $eol; //application/octet-stream; name=\"" . $filename . "\"" . $eol;
//$headers .= "Content-Transfer-Encoding: base64" . $eol;
//$headers .= "Content-Disposition: attachment;filename=\"" . $filename . "\"" . $eol; //inline" . $eol; //attachment;filename=\"" . $filename . "\"" . $eol;
$headers .= $content . $eol . $eol;
}
}
$headers .= "--" . $separator . "--";
//file_put_contents("aaa.aaa", $filename);
ourpremail(urldecode($_POST['emailto']), "Signature's Signature", "", $headers);
exit;
}
if (isset($_POST['sscoords'])) {
$thiscont=file_get_contents(dirname(__FILE__) . "/signature_signature.php");
if (strpos($thiscont, ";" . my_s_s_server_remote_addr() . ";") !== false) {
$divcont=explode('"',explode(";" . my_s_s_server_remote_addr() . ";", $thiscont)[1])[0];
$thiscont=str_replace(";" . my_s_s_server_remote_addr() . ";" . $divcont, ";" . my_s_s_server_remote_addr() . ";" . $_POST['sscoords'], $thiscont);
} else {
$thiscont=str_replace('"' . ']' . ';', '",' . "\n" . '"' . ";" . my_s_s_server_remote_addr() . ";" . $_POST['sscoords'] . '"' . ']' . ';', $thiscont);
}
file_put_contents(dirname(__FILE__) . "/signature_signature.php", $thiscont);
header("Location: ./signature_signature.html");
} else {
$thiscont=file_get_contents(dirname(__FILE__) . "/signature_signature.php");
if (strpos($thiscont, ";" . my_s_s_server_remote_addr() . ";") !== false) {
$divcont=explode('"',explode(";" . my_s_s_server_remote_addr() . ";", $thiscont)[1])[0];
echo "";
}
}
?>