Arabic encoding (form mail)
Bonjour tout le monde,
après plusieurs essais je demande votre aide pour l'encoding arabe lors de l'envoi d'un message vers une boite émail par un formulaire html/asp, quand j'envoie le message je le reçois sous des caractères inconnus!
page html:
Code:
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
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="ar" dir="rtl" xml:lang="ar">
<body>
<head>
<meta http-equiv="Content-Type" content="text/html" charset="utf-8" />
</head>
<form name="form1" method="post" action="newsletterprocess.asp">
<table border="0" cellpadding="2" cellspacing="2">
<tr>
<td style="color:#804000" width=24%>العنوان الالكتروني:</td>
<td><input name="email" type="text" style="width:200px"></td>
</tr>
<tr>
<td style="color:#804000">الاسم الكامل:</td>
<td><input name="Nom" type="text" id="Nom" style="width:200px"></td>
</tr>
<tr>
<td style="color:#804000">الموضوع:</td>
<td><input name="Sujet" type="text" id="Sujet" style="width:200px"></td>
</tr>
<tr>
<td style="color:#804000"><br />النص:</td></tr>
<tr>
<td colspan=2><textarea name="Message" id="Message" rows="10" onClick="SelectAll('txtarea');" style="width:400px" ></textarea></td>
</tr>
<tr>
<td> </td>
<td><input type="submit" name="Submit" value="ارسال"></td>
</tr>
</table>
</form>
</body>
</html> |
page ASP/
Code:
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 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
|
<%
' SETTINGS
' Type the distribution list managing address:
emailmanager = "mail@yahoo.fr"
' Type the positive and negative reply pages URLs
' (if the pages are placed in the same directory you can omit the full path
' and just enter the file name, otherwise enter the full URL):
urlok = "formok.htm"
urlko = "formko.htm"
' If the server is not setup for e-mail sending, enable the SpecifySMTP
' (set the value 1) and specify the SMTP server name to be used (ask your provider)
SpecifySMTP = 0
ServerSMTP = "localhost"
' END SETTINGS
msg = ""
For Each k in Request.Form
If Lcase(k) <> "submit" Then
msg = msg & k & ":" & Request.Form(k) & chr(13) & chr(10)
End If
next
email = Request.Form("email")
Set rex = New RegExp
With rex
.Pattern = "^([a-zA-Z0-9_\.-]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$"
.IgnoreCase = True
.Global = True
End With
Ok = rex.Test(email)
If Ok And (msg <>"") Then
if SpecifySMTP = 0 Then ServerSMTP = ""
Mail emailmanager,"Message internaute",msg,email, ServerSMTP
Response.Redirect urlok
Else
Response.Redirect urlko
End If
Function Mail(strTo, strSubject, strBody, strFrom, strSMTP)
set iMsg = CreateObject("CDO.Message")
If strSMTP <> "" Then
set iConf = CreateObject("CDO.Configuration")
Set Flds = iConf.Fields
Flds("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
Flds("http://schemas.microsoft.com/cdo/configuration/smtpserver") = strSMTP
Flds.Update
End If
With iMsg
If strSMTP <> "" Then
Set .Configuration = iConf
End If
.TextBody = strBody
.To = strTo
.From = strFrom
.Subject = strSubject
.Send
End With
Set iMsg = Nothing
Set iConf = Nothing
Set Flds = Nothing
End Function
%> |
j'ai essayé avec utf-8, iso-8859-6/1 et ibm-864 mais sans resultats!!