problem UTF-8 formmail

Discussion in 'Classic ASP' started by dodo, Feb 20, 2006.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. I have a SQL 2000 DB that uses unicode...I store the name of my users in a session object..setting its charset to 65001 (utf8).. When the user uses my Formmail the ASP code include his email, name address and some other informations ,Formail charset is UTF-8, but when i send it using CDO i recievethe message on the webmail (onDASP) like this ???????? , ???

    All theobjects on my formmail are utf8... including request. object and URLS...
    I tried to set the HMLbody of the CDO as charset = utf8 but in vain


    Any help? why the character in the message i receive are like this ?????????
     
  2. will any body answer me?
    I need to make my Pop email reads UTF8 messages

    how can I do that!![​IMG]
     
  3. There are many things that can cause this. The reason why you are seeing the ?? is because the unicode type you are using isn't being properly translated.

    This can happen on the application level (asp, asp.net, php) or at the component level (aspmail, etc).

    What language are you using? asp.net? It sounds like you need to translate the UTF-8 into a "string" type before you create the email. Try using either row[x].ToString() or Convert.ToString().

    The problem could also be happening either when you are assigning the Session variable or using the variable.


    Joel Thoms
    DiscountASP.NET
    http://www.DiscountASP.NET
     
  4. I am using classical ASP /CDo mail component


    the Session and request object (and all my website) is set to UTF8 to make the sever reads Arabic correctly fom the Database, so when My form retrieves the data of the sender and include it in the message, the whole message becomes unreadable..


    I tries pure UTF8 formmail, but since the request/session objects are UTF8 every thing turnes in ???


    I tries pure ANSI formmail, but I got stange characters that don't belong to any language!


    of course thename of the sender and the ID are bth stored in a session object..



    Is there an exmple on using Convert.ToString() in the KB section???
     
  5. it is like this one..but I deleted the page after it sent me the strange characters








    Sub SendMail (sFromAddress, sToAddress, sCcAddress, sBccAddress, sSubject, sBody, boolReadReceipt, intImportance )
    ' on error resume next
    Const cdoDispositionNotificationTo = "urn:schemas:mailheader:disposition-notification-to"
    Const cdoReturnReceiptTo = "urn:schemas:mailheader:return-receipt-to"
    dim cdoMessage, cdoConfiguration

    Set cdoConfiguration = Server.CreateObject ("CDO.Configuration")
    ' Outgoing SMTP server
    With cdoConfiguration
    .Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost"
    .Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
    .Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
    .Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
    .Fields.Update
    End With


    Set cdoMessage = CreateObject("CDO.Message")
    With cdoMessage
    ' Update the CDOSYS Configuration
    SET .Configuration = cdoConfiguration
    .BodyPart.charset = "unicode-1-1-utf-8"

    IF boolReadReceipt Then
    .Fields(cdoDispositionNotificationTo) = sFromAddress
    .Fields(cdoReturnReceiptTo) = sFromAddress
    End If

    ' Set the Importance: 0:Low, 1:Normal, 2:High
    .Fields("urn:schemas:httpmail:importance").Value = intImportance
    .Fields.Update
    .From = sFromAddress
    .ReplyTo = sFromAddress
    .To = sToAddress
    .Cc = sCcAddress
    .Bcc = sBccAddress
    .Subject = sSubject
    .Textbody = sBody
    .Send
    End With

    Set cdoMessage = Nothing
    Set cdoConfiguration = Nothing
    End Sub
     
  6. There can be a few spots of failure. It is either not reading the database properly (you can test this, by doing a Response.Write(...) with the values to see if they are properly displayed on a webpage.


    It can also fail when being sent in the message, the mime type might not be compatible with your type or there could also be an incompatibility with the component itself.



    Joel Thoms
    DiscountASP.NET
    http://www.DiscountASP.NET
     
  7. ok
    May beI missexplained my case
    I have an internal page where people should login using a p[asword
    in this page there is a form that retreives the personal data of the user (name, phone, departement...etc) from the database. and allows the user to send his/her request or query to the departement...

    After this form is filled and submited , the form-page shows the user the text that he/she sent..
    every thing till here is fine and the data is show nicly. But when I receive the email sent by the page, the ubject, sender and all the body is "??????"

    the whole form is UTF-8... but it sounds that the webmail pages are Ansi(even Hotmail)

    What should I do to turn utf-8 text to Ansi 1256 innthe body of the email message??
     
  8. I found this from here (http://lists.evolt.org/archive/Week-of-Mon-20030901/147844.html)


    With .Bodypart ' Initialize the bodypart to support UTF-8
    .ContentMediaType = "text/plain"
    .ContentTransferEncoding = "7bit"
    .Charset = "utf-8"
    SET Stm = .GetDecodedContentStream
    Stm.WriteText strBody
    Stm.Flush
    End With

    That should initialize as UTF8. If this doesn't work, try removing all initialization to see if it'll send correctly.


    Joel Thoms
    DiscountASP.NET
    http://www.DiscountASP.NET
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page