2017-01-09 13 views
0

私はIISに追加されたHTMLフォームを持っており、電子メールを送信するためにasp.netを使用しています。ラテン文字では問題はありません。しかし、アラビア文字を渡すとき、私は受信箱の疑問符で受け取る。ここで私は(例えばWindowsの-1256として、ISO-8859-6)運と多くの文字セットを試してみましたASPasp iis7を使用したアラビア語の設定

<% 
Response.ContentType = "text/html" 
Response.AddHeader "Content-Type", "text/html;charset=utf-8" 
Response.CodePage = 65001 
Response.CharSet = "utf-8" 

'EmailSubject = request.querystring("subject") 
EmailBody = request.querystring("name") & " " & request.querystring("email") & vbcrlf & request.querystring("message") 
Const EmailFrom = "[email protected]" 
'Const EmailFromName = request.querystring("fullname") 
Const EmailTo = "[email protected]" 
Const SMTPServer = "smtp.gmail.com" 
Const SMTPLogon = "[email protected]" 
Const SMTPPassword = "password" 
Const SMTPSSL = True 
Const SMTPPort = 465 

Const cdoSendUsingPickup = 1 'Send message using local SMTP service pickup directory. 
Const cdoSendUsingPort = 2 'Send the message using SMTP over TCP/IP networking. 

Const cdoAnonymous = 0 ' No authentication 
Const cdoBasic = 1 ' BASIC clear text authentication 
Const cdoNTLM = 2 ' NTLM, Microsoft proprietary authentication 

' First, create the message 

Set objMessage = CreateObject("CDO.Message") 
objMessage.Subject = EmailSubject 
objMessage.From = """" & EmailFromName & """ <" & EmailFrom & ">" 
objMessage.To = EmailTo 
objMessage.HtmlBody = EmailBody 

' Second, configure the server 

objMessage.Configuration.Fields.Item _ 
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 

objMessage.Configuration.Fields.Item _ 
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = SMTPServer 

objMessage.Configuration.Fields.Item _ 
("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = cdoBasic 

objMessage.Configuration.Fields.Item _ 
("http://schemas.microsoft.com/cdo/configuration/sendusername") = SMTPLogon 

objMessage.Configuration.Fields.Item _ 
("http://schemas.microsoft.com/cdo/configuration/sendpassword") = SMTPPassword 

objMessage.Configuration.Fields.Item _ 
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = SMTPPort 

objMessage.Configuration.Fields.Item _ 
("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = SMTPSSL 

objMessage.Configuration.Fields.Item _ 
("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60 

objMessage.BodyPart.Charset = "utf-8" 

objMessage.Configuration.Fields.Update 
'Now send the message! 
On Error Resume Next 
objMessage.Send 
%> 

でコードの最後に予め

答えて

0

おかげであり、私が見つかりました。溶液Iが

Response.ContentType = "text/html" 
Response.AddHeader "Content-Type", "text/html;charset=utf-8" 
Response.CodePage = 65001 
Response.CharSet = "utf-8" 

以下の行を削除し、Set objMessage = CreateObject("CDO.Message")コードの下に追加:

objMessage.BodyPart.Charset = "utf-8" 
関連する問題