<?php
############################
include 'mail.conf.php';
############################
$top='<html dir="rtl">
<head>
<meta http-equiv="Content-Language" content="fa">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<div align="center">
<p style="margin-top: 0; margin-bottom: 0">
<font face="Tahoma" size="1" color="#003366">بنام خدا</font></p>
<p style="margin-top: 0; margin-bottom: 0"><b>
<font face="Tahoma" size="1" color="#003366">سفارش جدید ارسال شده است</font></b></p>
<p style="margin-top: 0; margin-bottom: 0"><font face="Tahoma" size="1"> </font></p>
<table border="0" cellpadding="0" style="border-collapse: collapse" width="500" height="20" bordercolor="#000000" id="table1">
<tr>
<td style="border-style: solid; border-width: 1px; font-family:Tahoma; font-size:9pt" height="24" bordercolor="#333333" colspan="2">
<p align="center">توصیه میکنیم حتما از این فرم یک پرینت بگیرید.
<a href="javascript:print()">
<input type="button" name="print" value="گرفتن پرینت" style="text-transform: uppercase; font-family: Tahoma; font-size: 8pt"></a></td>
</tr>
<tr>
<td width="161" height="24" style="border-style: solid; border-width: 1px" bgcolor="#F4F4F4" bordercolor="#333333">
<p align="center" style="margin: 2px 5px"><b>
<font face="Tahoma" style="font-size: 9pt">نام گزینه</font></b></td>
<td height="24" style="border-style: solid; border-width: 1px" bgcolor="#F4F4F4" bordercolor="#333333">
<p align="center" style="margin: 2px 5px"><b>
<font face="Tahoma" style="font-size: 9pt"> اطلاعات وارد شده توسط
کاربر</font></b></td>
</tr>';
##############################
$body=' <tr>
<td width="161" style="border-style: solid; border-width: 1px" height="24" bordercolor="#333333">
<p align="center" style="margin: 2px 5px"><span lang="en-us">
<font face="Tahoma" style="font-size: 9pt">%field</font></span></td>
<td style="border-style: solid; border-width: 1px" height="24" bordercolor="#333333">
<p align="justify" style="margin: 2px 10px; "><span lang="en-us">
<font face="Tahoma" style="font-size: 9pt">%info</font></span></td>
</tr>';
##############################
$footer=' </table>
<p style="margin-top: 0; margin-bottom: 0"> </p>
<p style="margin-top: 0; margin-bottom: 0"><b><font face="Tahoma" size="1"> </font></b></div>
<div align="center">
<table border="0" cellpadding="0" style="border-collapse: collapse" width="500" height="20" bordercolor="#000000" id="table2">
<tr>
<td height="25" style="border-style: solid; border-width: 1px" bgcolor="#336699" colspan="2" bordercolor="#333333">
<p style="margin-top: 0; margin-bottom: 0" align="center"><b>
<font face="Tahoma" size="1" color="#FFFFFF">مشخصات کاربر</font></b></p>
</td>
</tr>
<tr>
<td width="161" height="25" style="border-style: solid; border-width: 1px" bordercolor="#333333">
<p align="center" style="margin: 2px 5px">
<font face="Tahoma" style="font-size: 9pt">آی پی کاربر</font></td>
<td height="25" style="border-style: solid; border-width: 1px" bordercolor="#333333">
<p align="center" style="margin: 2px 5px"><span lang="en-us">
<font face="Tahoma" style="font-size: 9pt">%ip</font></span></td>
</tr>
<tr>
<td width="161" style="border-style: solid; border-width: 1px" height="25" bordercolor="#333333">
<p align="center" style="margin: 2px 5px">
<font face="Tahoma" style="font-size: 9pt">لینک معرف</font></td>
<td style="border-style: solid; border-width: 1px" height="25" bordercolor="#333333">
<p align="center" style="margin: 2px 5px"><span lang="en-us">
<font face="Tahoma" style="font-size: 9pt">%link</font></span></td>
</tr>
</table>
<p align="center" style="margin: 2px 5px"> <p align="center" style="margin: 2px 5px"> </div>
<p align="center" dir="ltr" style="margin-top: 2px; margin-bottom: 2px">
<span lang="en-us"><font face="Verdana" size="1" color="#333333">if you can,t
Read this , change the encoding to UTF-8</font></span></p>
<p align="center" style="margin-top: 2px; margin-bottom: 2px">
<span lang="en-us"><font size="1" face="Verdana">
<a href="mailto:[email protected]"><font color="#800000">Powered By: Mojtaba Bolhasani ([email protected])</font></a></font></span></p>
<p align="center"> </p>
</body>
</html>';
##############################
if (isset($_POST['email']))
$email=$_POST['email'];
else
$email=$from;
if (isset($_POST['subject']))
$subject=$_POST['subject'];
##############################
$header='From: "'.$email.'" <'.$email.">\r\n"
.'Reply-To: "'.$email.'" <'.$email.">\r\n"
.'To:<'.$to.">\r\n"
.'CC:<'.$email.">\r\n"
."Mime-Version: 1.0\r\n"
."Content-type: text/html; charset=utf-8\r\n"
."Content-Transfer-Encoding: 7bit\r\n";
##############################
$main='';
foreach($_POST as $k => $v)
{
$lists=$body;
$lists=ereg_replace('%field',$k,$body);
$lists=ereg_replace('%info',$v,$lists);
$main .=$lists;
}
#############################
$ip= $_SERVER['REMOTE_ADDR'];
$link=$_SERVER['HTTP_REFERER'];
$footer=ereg_replace('%ip',$ip,$footer);
$footer=ereg_replace('%link',$link,$footer);
$body=$top.$main.$footer;
if ( mail($to,$subject,$body, $header)){
$url="index.php";// آدرس صفحه ای که بعد از ارسال ایمیل میخواهید به آنجا بروید
echo "<meta http-equiv=\"refresh\" content=\"0; url=$url\" />";
exit();
}
else {
$url="index.php";//آدرس صفحه ای که در صورت ارسال نشدن ایمیل میخواهید مرورگر به آنجا منتقل شود
echo "<meta http-equiv=\"refresh\" content=\"0; url=$url\" />";
exit();
}
?>