persiangolf.ir
Member
سلام،من يك تابع ايميل درست كردم ولي اصلا كار نمي كنه از دوستان مي خوام كد هاشو نگاه كنن
تابع خيلي ساده هست ولي وقتي روي سرور مي زارم كار نمي كنه.
اين يك فايل هست به نام send mail.html
-------------------------------------------------------------------------------------------
<form action="sendMail.php" enctype="multipart/form-data" method="post" style="vertical-align:top" target="_self" >
<table width="400" height="100" border="0" align="right" style="text-align:right;font-family:Tahoma;font-size:12px;direction:rtl;border:none;vertical-align:top">
<tr>
<td style="width:100px"><font color="#00709C"> پست الكترونيكي ما:</font></td>
<td style="color:#2D7104">[email protected]</td>
</tr>
<tr>
<td style="width:100px"><font color="#00709C">پست الكترونيكي:</font></td>
<td><input type="text" name="frm" value="" size="20" /></td>
</tr>
<tr>
<td><font color="#00709C">موضوع:</font></td>
<td><input type="text" name="subject" size="20" /></td>
</tr>
<tr>
<td style="vertical-align:top"><font color="#00709C">پيغام:</font></td>
<td><textarea name="msg" cols="20" rows="6" ></textarea></td>
</tr>
<tr>
<td>
</td>
<td>
<input type="submit" name="send" value="ارسال" style="font-family:Tahoma;font-size:12px;direction:rtl"/>
</td>
</tr>
</table>
</form>
-------------------------------------------
و بعد كد هاي php كه get مي شه به اين فايل
--------------------------------------------------------------
<?php
$to="[email protected]";
$sb=$_POST["subject"];
$frm=$_POST["frm"];
$msg=$_POST["msg"];
$header="From:$frm";
if(mail($to,$sb,$msg,$header)){
echo "Send OK !";
}else{
echo "Send Failed !!!";
}
?>
ممنونم
تابع خيلي ساده هست ولي وقتي روي سرور مي زارم كار نمي كنه.
اين يك فايل هست به نام send mail.html
-------------------------------------------------------------------------------------------
<form action="sendMail.php" enctype="multipart/form-data" method="post" style="vertical-align:top" target="_self" >
<table width="400" height="100" border="0" align="right" style="text-align:right;font-family:Tahoma;font-size:12px;direction:rtl;border:none;vertical-align:top">
<tr>
<td style="width:100px"><font color="#00709C"> پست الكترونيكي ما:</font></td>
<td style="color:#2D7104">[email protected]</td>
</tr>
<tr>
<td style="width:100px"><font color="#00709C">پست الكترونيكي:</font></td>
<td><input type="text" name="frm" value="" size="20" /></td>
</tr>
<tr>
<td><font color="#00709C">موضوع:</font></td>
<td><input type="text" name="subject" size="20" /></td>
</tr>
<tr>
<td style="vertical-align:top"><font color="#00709C">پيغام:</font></td>
<td><textarea name="msg" cols="20" rows="6" ></textarea></td>
</tr>
<tr>
<td>
</td>
<td>
<input type="submit" name="send" value="ارسال" style="font-family:Tahoma;font-size:12px;direction:rtl"/>
</td>
</tr>
</table>
</form>
-------------------------------------------
و بعد كد هاي php كه get مي شه به اين فايل
--------------------------------------------------------------
<?php
$to="[email protected]";
$sb=$_POST["subject"];
$frm=$_POST["frm"];
$msg=$_POST["msg"];
$header="From:$frm";
if(mail($to,$sb,$msg,$header)){
echo "Send OK !";
}else{
echo "Send Failed !!!";
}
?>
ممنونم