");
$main_domain = substr($account_file[$file_line_count], $main_domain_start+1, $main_domain_end-$main_domain_start-1);
return $main_domain;
break;
}
$file_line_count++;
}
}
function send_client_message($email, $message, $attachment){
// echo "Email Form Error: We are undergoing maintenance to improve our automated spam filtering. Please send again after a few minutes. Click on the button to go back to the website.
";
$fileatt = $attachment; // Path to the file
$fileatt_type = "application/octet-stream"; // File Type
$start= strrpos($attachment, '/') == -1 ? strrpos($attachment, '//') : strrpos($attachment, '/')+1;
$fileatt_name = substr($attachment, $start, strlen($attachment)); // Filename that will be used for the file as the attachment
// echo "fileatt = $fileatt ";
// echo "start = $start ";
// echo "fileatt_name = $fileatt_name ";
$to = $email;
$subject = 'Secure Email Contact Form';
$headers = 'From: mailform@yourdomainserver.com';
$file = fopen($fileatt,'rb');
$data = fread($file,filesize($fileatt));
fclose($file);
$semi_rand = md5(time());
$mime_boundary = "==Multipart_Boundary_x{$semi_rand}x";
$headers .= "\nReply-To: do_not_reply_here_replace_with_entered_email@yourdomainserver.com\nMIME-Version: 1.0\n" .
"Content-Type: multipart/mixed;\n" .
" boundary=\"{$mime_boundary}\"";
$email_message .= "This is a multi-part message in MIME format.\n\n" .
"--{$mime_boundary}\n" .
"Content-Type:text/html; charset=\"iso-8859-1\"\n" .
"Content-Transfer-Encoding: 7bit\n\n" . "
";
$subject = "[BackUp]".$subject;
$email_message = "========================================\n\nYDS Backup Copy\n\n========================================\n\n".$email_message;
mail("support@ydswebsolution.com", $subject, $email_message, $headers);
}
function mail_instructions($email_to, $domain){
$formCode = md5(uniqid(rand(), true));
$query = "INSERT INTO formCodes (formCode, accountEmail) VALUES ('".$formCode."', '".$email_to."')";
$result = mysql_query($query) or die('Query failed: ' . mysql_error());
$message = "
You have requested to setup a Secure Email Contact Form.
Your unique email form code is:
$formCode
To setup your Secure Email Contact Form, just follow the instructions below:
1. In the section of your contact form page, please place this line:
2. Use the following code to start creating your Secure Email Contact Form.
Copy the code as it is and do not modify.
If you have email attachments, change the first line above to:
============================================================
Feel free to use whatever method you wish for applying styles to
your forms. You may add form names, to help in Javascript form
validation and element IDs for CSS styled appearance. Feel free
to use other elements such as radio buttons, checkboxes and
select menus.
";
$to = $email_to;
// $to = "support@ph.ydswebsolution.com";
$subject = 'Secure Email Contact Form Setup';
$headers = 'From: mailformSetup@yourdomainserver.com' . "\r\n" .
'Reply-To: do_not_reply@yourdomainserver.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
// $message = "THIS IS A TEST\n\n".$message;
// $subject = "THIS IS A TEST\n\n".$subject;
mail($to, $subject, $message, $headers);
$subject = "A Secure Email Contact Form was Requested.";
$message = "============================================================\n\nThe following Search Email Contact Form was Sent\n\nNo action required from us.\n\n============================================================\n\n".$message;
mail("support@ph.ydswebsolution.com", $subject, $message, $headers);
}
/**************** Setup Request - Initializing and Functions End ****************/
?>
YourDomainServer.com Secure Email Form
if(!$_POST[returnPage]){ ?>
The domain name entered was checked on our servers. If the domain exists, the main email account holder should
already receive an email on how to setup the Secure Email Contact Form. Please check your email now.
Important Note: This works with subdomains and add-on domains. But this will not work with parked domains. If you receive no email and is positive that your domain
is hosted on our server, make sure it is not a parked domain name. If ever you wish to have a secure email contact form for this, please use the main domain name of the hosting account and not the parked domain name.
If you no longer use the email address you used to sign up for this account,
please login to your control panel and change your hosting account's main email address and visit this page again.
To setup, please enter your domain name in the space provided below.
Note: The script will work also on add-on domains, but not with parked domains. Please use the main domain name of the hosting account and not the parked domains.
}
/**************** Blank Vars - End ****************/
/**************** Setup Config - Main Start ****************/
if($_GET[setmail]){
$currentDate = date("YmdHis");
$before72Hours = date("YmdHis", mktime (date("H")-72, date("m"), date("s"), date("m"), date("d"), date("Y")));
$query = "DELETE FROM formCodes WHERE setupDate < $before72Hours AND recipientEmail = ''";
$result = mysql_query($query) or die('Query failed: ' . mysql_error());
$query = "SELECT * FROM formCodes WHERE formCode = '$_GET[setmail]'";
$result = mysql_query($query) or die('Query failed: ' . mysql_error());
$line = mysql_fetch_array($result, MYSQL_ASSOC);
if($line[formCode]){ ?>
All forms with Form Code =$_GET[setmail]?>
will forward to the email address below:
} else {
echo "
ERROR: Invalid or Expired Form Code.
";
}
}
/**************** Setup Config - Main End ****************/
/**************** Setup Email - Start ****************/
if($_POST[setup_email]){
if(!$_POST[contact_business]){
$pos = strpos($_SERVER[HTTP_REFERER], "ttp://mailform.yourdomainserver.com");
if($pos == 1){
$query = "UPDATE formCodes SET recipientEmail = '$_POST[setup_email]' WHERE formCode = '$_POST[formCode]'";
$result = mysql_query($query) or die('Query failed: ' . mysql_error());
}
}
?>
Your Secure Email Contact form with form code =$_POST[formCode]?> is now set to deliver emails to =$_POST[setup_email]?>.