رتبه موضوع:
  • 0 رای - 0 میانگین
  • 1
  • 2
  • 3
  • 4
  • 5
مشکل ارسال ایمیل چیه ؟
#1
سلام، بنده می خوام یک ایمیل رو از طریق یک فرم ارسال کنم ...، ایمیل ارسال می شه ولی یک ارور هم در کنارش می ده :

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/lmspcir1/public_html/PHP/Mail.php:3) in /home/lmspcir1/public_html/PHP/Mail.php on line 20
Your Message Sent !
مشکل جیه؟
پاسخ
تشکر شده توسط:
#2
فایلهاتون رو با کدگذاری UTF-8 without BOM ذخیره کنید.
پاسخ
تشکر شده توسط:
#3
این کار رو کردم ولی درست نشد، این هم کدش :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
session_start();
?>
<meta charset="utf8">
<title>Sending E-Mail | ارسال رایانامه</title>
<?php
 
if($_POST['captcha'] == $_SESSION['captcha']) {
 
    $nameFamily=$_POST['nameFamily'];
    $mail=$_POST['mail'];
    $phone=$_POST['phone'];
    $text=$_POST['text'];
 
    $headers = "MIME-Version: 1.0\r\n";
    $headers .= "Content-type: text/html; charset=UTF-8\r\n";
    $headers .= "From:".$mail."; <".$mail.">\r\nReply-To: ".$mail.";";
 
    $text="<div style='font:12px Segoe UI'>Name & Family : ".$nameFamily."<br>
    E-Mail : ".$mail."<br>
    Phone : ".$phone."<br>
    Explanation : ".$text."</div>";
 
    $to="ABZiko@chmail.ir";
    $subject="Request from ".$nameFamily;
 
    if(mail($to,$subject,$text,$headers)) {
    echo "<div style='font:12px Segoe UI'>Your Message Sent !</div>";}
 
    else{
    echo "<div style='font:12px Segoe UI'>Your Message Didn't Sent !</div>"; }
     
}
else{
    echo "<div style='font:12px Segoe UI'>Your Security Code is Entered Wrongly !</div>";
}
 
?>

البته بنده از Captcha هم استفاده می کنم که این هم کدش :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php
 
session_start();
$code=rand(100000,999999);
$_SESSION["captcha"]=$code;
 
$im = imagecreate(100, 50);
 
$bg = imagecolorallocate($im, 22, 86, 165);
$fg = imagecolorallocate($im, 255, 255, 255);
 
imageline($im, rand(0,100), rand(0,50), rand(0,100), rand(0,50), $fg);
imageline($im, rand(0,100), rand(0,50), rand(0,100), rand(0,50), $fg);
imageline($im, rand(0,100), rand(0,50), rand(0,100), rand(0,50), $fg);
imageline($im, rand(0,100), rand(0,50), rand(0,100), rand(0,50), $fg);
imageline($im, rand(0,100), rand(0,50), rand(0,100), rand(0,50), $fg);
 
$x=mt_rand(0,30);
$y=mt_rand(30,35);
$textAngle=mt_rand(-15,15);
 
imagettftext($im, 20, $textAngle, $x, $y, $fg, "BRUSHSCI.TTF", $code);
header("Cache-Control: no-cache, must-revalidate");
header('Content-type: image/png');
imagepng($im);
imagedestroy($im);
 
?>
پاسخ
تشکر شده توسط:
#4
مطمئنید without BOM ذخیره کردین؟ دقت کنید که تمام فایلهاتون باید با این کدگذاری ذخیره بشن.
پاسخ
تشکر شده توسط:




کاربران در حال بازدید این موضوع: