سلام
برای اینکه اطلاعاتی به یه ایمیل با php بفرستم با فارسی نمیشه
چه کدی هست برای php که بشه این کارو کرد؟
سلام
برای اینکه اطلاعاتی به یه ایمیل با php بفرستم با فارسی نمیشه
چه کدی هست برای php که بشه این کارو کرد؟
komakkkkkkkkkkkkkkkk
Header که برای ارسال ایمیل میفرستید UTF-8 کنید
$headers= "Content-Type: text/plain;charset=utf-8\r\n";
یا
$headers= "Content-Type: text/html;charset=utf-8\r\n";
واقعا دستتون درد نکنه
کل اینرنت رو زیر رو کردم هیچ کدوم کار نمیکرد از جمله همین کد
* دالر هدر چه کاری معنیش چیه؟
کد هایی که ازشون استفاده میکنم
کد HTML:<?phpmysql_set_charset('utf8');$to = 'danielmerikhi@yahoo.com';$subject = 'تماس'; // message$message = '<!doctype html><html> <head> <meta charset="utf-8"> <title>Birthday Reminders for August</title></head><body><p>Here are the birthdays upcoming in August!</p><table><tbody><tr><th>نام</th><th>Day</th><th>Month</th><th>Year</th></tr><tr><td>Joe</td><td>3rd</td><td>August</td><td>1970</td></tr><tr><td>Sally</td><td>17th</td><td>August</td><td>1973</td></tr></tbody></table></body></html>'; // To send HTML mail, the Content-type header must be set$headers = 'MIME-Version: 1.0' . "\r\n";$headers= "Content-Type: text/plain;charset=utf-8\r\n";$headers .= 'To: Mary <mary@example.com>, Kelly <kelly@example.com>' . "\r\n";$headers .= 'From: Birthday Reminder <birthday@example.com>' . "\r\n";$headers .= 'Cc: birthdayarchive@example.com' . "\r\n";$headers .= 'Bcc: birthdaycheck@example.com' . "\r\n";mail($to, $subject, $message, $headers); $mail->CharSet = 'UTF-8';?> خروجی:(در ایمیل) [COLOR=#000000][FONT=Helvetica Neue]Here are the birthdays upcoming in August![/FONT][/COLOR] نامDayMonthYearJoe3rdAugust1970Sally17thAugust1973
<?phpmysql_set_charset('utf8');
$to = 'danielmerikhi@yahoo.com';
$subject = 'تماس';
// message
$message = '
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Birthday Reminders for August</title>
</head>
<body><p>Here are the birthdays upcoming in August!</p>
<table>
<tbody>
<tr><th>نام</th><th>Day</th><th>Month</th><th>Year</th></tr>
<tr>
<td>Joe</td>
<td>3rd</td>
<td>August</td>
<td>1970</td>
</tr>
<tr>
<td>Sally</td>
<td>17th</td>
<td>August</td>
<td>1973</td>
</tr>
</tbody>
</table></body>
</html>
';
// To send HTML mail, the Content-type header must be set
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers= "Content-Type: text/plain;charset=utf-8\r\n";
$headers .= 'To: Mary <mary@example.com>, Kelly <kelly@example.com>' . "\r\n";
$headers .= 'From: Birthday Reminder <birthday@example.com>' . "\r\n";
$headers .= 'Cc: birthdayarchive@example.com' . "\r\n";
$headers .= 'Bcc: birthdaycheck@example.com' . "\r\n";
mail($to, $subject, $message, $headers);
?>
Here are the birthdays upcoming in August!
نام Day Month Year Joe 3rd August 1970 Sally 17th August 1973
از این کد بالای صفحه استفاده کردید؟
<meta http-equiv="Content-Type" content="text/html charset=UTF-8" />
<?phpmysql_set_charset('utf8');
$to = 'danielmerikhi@yahoo.com';
$subject = 'تماس';
// message
$message = '
<!doctype html>
<html>
<head>
<meta charset="utf-8">
بله
اینو اول فایلت بگذار
header('Content-Type:text/html; charset=utf-8');
من که به نتیجه ای نرسیدم
از من که می فرسته ،بیا این هم کدهای من:
<?php
header('Content-Type:text/html; charset=utf-8');
if(isset($_POST['email'])){
$email_address='p30online@yahoo.com';
$email_name = "succesfull";
$formtext1 = $_POST['name'];
$formtext2 = $_POST['email'];
$formtext3 = $_POST['tel'];
$formtext4 = $_POST['website'];
$formtext5 = $_POST['message'];
$msg_body = "NAME: $formtext1\n";
$msg_body .= "EMAIL: $formtext2\n";
$msg_body .= "TEL: $formtext3\n";
$msg_body .= "WEBSITE: $formtext4\n";
$msg_body .= "MESSAGE: $formtext5\n";
$headers = "";
$headers .= "From: " . $email_name . " <" . $email_address . ">\n";
$headers .= "X-Sender: <" . $email_address . ">\n";
$headers .= "X-Mailer: PHP\n";
$headers .= "X-Priority: 1\n";
$headers .= "Return-Path: <" . $email_address . ">\n";
$headers .= "Content-Type: text/html; charset=UTF-8\n";
@mail($email_address, "mysite", "<pre>" . $msg_body . "</pre>", $headers);
echo "<center>ایمیل با موفقیت ارسال شد!</center>";
header('location:index.html#message');
exit;
}else{
}
?>
ممکنه مشکل از هاست رایگانم باشه؟
دستتون درد نکنه. بعد ایییییییییییییین همه سوال و پاسخ تازه یادتون افتاده اینو بگید؟
مثالهایی که براتون زدن همشون درسته. ایراد از جای دیگست.
من نمیدونستم ممکنه ربط داشته باشه