dan78
-
Total Posts
:
1
- Scores: 0
-
Reward points
:
0
- Joined: 6/15/2009
-
Status: offline
|
asp utf8 mysql cdosys
Monday, June 15, 2009 10:51 PM
( permalink)
Hi, my problem is the character encoding of Cyrillic, I put the correct data in the db correctly or sending the mail, I can not satisfy both requirements. The db tables and columns all set to utf8 and the following page pag1.asp enter the correct data in the db, the mail is incorrect calls (not coded correctly type ¾ Ð ¿Ð ¾ Ð »Ð ½ Ð ¸ Ñ") . Adding on top of the page <% @ CodePage = "65001"%> "is sent correctly mail, db is included in all ?????? Thanks in advance
<%
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "Driver={MySQL ODBC 3.51 Driver};Server=ip;charset=UTF8;Database=db;User=user; Password=pas;Option=3;"
step = request("step")
if step = 1 then
nomeS = request("nomeS")
viaS = request("viaS")
sqlInsert="insert into archivioFaq (nomeS, viaS)values('"&nomeS&"','"&viaS&"')"
conn.execute("SET NAMES utf8")
conn.execute(sqlInsert)
messMail = nomeS&" "&viaS&"<br>"
Set Config = Server.CreateObject("CDO.Configuration")
Set Fields = Config.Fields
Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing")=2
Fields.Item("[link=http://schemas.microsoft.com/cdo/configuration/smtpauthenticate]http://schemas.microsoft.com/cdo/configuration/smtpauthenticate[/link]") = 1
Fields.Item("[link=http://schemas.microsoft.com/cdo/configuration/smtpserver]http://schemas.microsoft.com/cdo/configuration/smtpserver[/link]") = "localhost"
Fields.Update
Set MiaMail = Server.CreateObject("CDO.Message")
Set MiaMail.Configuration = Config
MiaMail.To = "miamail"
MiaMail.From = "miamail"
MiaMail.Bodypart.Charset = "UTF-8"
MiaMail.Subject = "oggetto"
MiaMail.HTMLBody = messMail
MiaMail.Send()
set MiaMail = Nothing
Set Fields = Nothing
Set Config = Nothing
end if
%>
<html>
<head>
<title>Amministrazione</title>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">
<!--
body {
background-color: #D4ECD4;
}
-->
</style>
<link href="../style.css" rel="stylesheet" type="text/css">
</head>
<body >
<form name="regDo" action="pag1.asp" method="post" >
<input type="hidden" name="step" value="1">
<tr>
<td colspan="3" class="textbold2"> </td>
</tr><tr><td colspan="3" class="textbold3"> </td>
</tr>
<tr>
<td bgcolor="#CCCCCC" class="textbold"><strong>Nome struttura<br>
<label>
<input name="nomeS" type="text" class="textbold" id="nomeS" size="40">
</label>
</strong></td>
<td bgcolor="#CCCCCC" class="textbold" ><strong>Indirizzo<br>
<input name="viaS" type="text" class="textbold" id="viaS" size="50">
</strong></td>
<td bgcolor="#CCCCCC" class="textbold"><label>
<input name="Submit2" type="submit" class="riepilogoTotali" value="REGISTRA FAQ">
</label></td>
</tr>
<tr>
<td colspan="4" class="testo"><hr noshade class="titVerde"></td>
</tr>
</form>
</body>
</html>
<%
conn.Close
Set conn=Nothing
%>
|
|
|
|
TNO
-
Total Posts
:
2094
- Scores: 36
-
Reward points
:
0
- Joined: 12/18/2004
- Location: Earth
-
Status: offline
|
RE: asp utf8 mysql cdosys
Friday, June 19, 2009 1:46 AM
( permalink)
To iterate is human, to recurse divine. -- L. Peter Deutsch
|
|
|
|