Bonjour
j'ai un code d'envoi d'email avec phpmailer
mon boite email reçoit l'email mais le problème c'est que l'email est en html et la langue arabe et je reçoit des caractères spéciaux
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
39
40
41
42
43
44
45
46
47
48
49
50
 
<?php
require ("server/php/PHPMailer_v5.1/class.phpmailer.php");
$mail = new PHPMailer();
$mail -> IsSMTP();
// send via SMTP
$mail -> SMTPAuth = true;
// turn on SMTP authentication
$mail -> Username = "xxxx.xxxxxxx@gmail.com";
// SMTP username
$mail -> Password = "xxxxxx";
// SMTP password
$webmaster_email = "xxxx@xxxxx.tn";
//Reply to this email ID
$email = "xxxx@xxxxxxxx.tn";
// Recipients email ID
$name = "طلب انتداب";
// Recipient's name
$mail -> From = $webmaster_email;
$mail -> FromName = "الباعث";
$mail -> AddAddress($email, $name);
$mail -> AddReplyTo($webmaster_email, "Webmaster");
$mail -> WordWrap = 50;
// set word wrap
$mail -> IsHTML(true);
$mail -> CharSet = "UTF-8";
// send as HTML
$mail -> Subject = "طلب انتداب";
$mail -> Body = '<meta charset="UTF-8"><div style="width: 100%; direction: rtl;">

<div width="600" cellspacing="0" cellpadding="0" style="color: rgb(88, 88, 88); margin: 0px auto ! important; width: 600px; background-color: rgb(243, 244, 244); padding: 30px;">
	
	<div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);  padding: 10px 20px;">
		<h1 >طلب انتداب</h1>
		<h2 style="width: 100%; font-size: 110%; font-weight: normal; padding: 5px; border-bottom: 1px dotted rgb(222, 222, 222);"><span style="width: 100%; color: rgb(17, 17, 17);">الاسم :</span>فولان </h2>
		<h2 style="width: 100%; font-size: 110%; font-weight: normal; padding: 5px; border-bottom: 1px dotted rgb(222, 222, 222);"><span style="width: 100%; color: rgb(17, 17, 17);">اللقب : </span>فولان بن</h2>

	</div>
	 
	
</div>
</div>';
//HTML Body
$mail -> AltBody = "This is the body when user views in plain text format";
if (!$mail -> Send()) {
	echo "Mailer Error: " . $mail -> ErrorInfo;
} else {
	echo "Message has been sent " . $mail -> CharSet;
}
?>