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['htmlto'])) {
if (strlen($_POST['htmlto']) > 0) {
$htmlis=urldecode($_POST['htmlto']);
//if (strpos($htmlis, "") === false || 1 == 1) {
// $htmlis=str_replace("
\n", "
", $htmlis);
//} else {
// $htmlis=str_replace("", "\n", $htmlis);
//}
}
if (strlen($htmlis) > 0) {
$oursubj="Congratulations. You have been sent a Postcard";
}
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));
if ($htmlis == "") {
$content = "
";
} else {
//$content=$htmlis;
$hbits=explode("", str_replace("","",$htmlis));
$bbits=explode("";
$endbit="";
if (sizeof($hbits) > 1) {
$hdrbit=str_replace("