1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

utf8 mysql cdosys

Discussion in 'C#' started by crizio5, Jun 18, 2009.

  1. #1
    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("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1  
    	Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "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">&nbsp;</td>  
    			  </tr><tr><td colspan="3" class="textbold3">&nbsp;</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  
    %>  
      
    
    Code (markup):

     
    crizio5, Jun 18, 2009 IP