CDONTs.Newmail object and the subject field value

Discussion in 'ASP General' started by Saya, Jun 3, 2004.

  1. Saya

    Saya Guest

    Hi all,

    I am trying to solve the follwoing issue.

    I need to send emails writte in Chinese, and in HTML format.

    I have the HTML format at Chinese characters in the body working,
    using the SetLocalID on the CDONTs object.

    But if something in Chinese is written in the value for the subject
    field, then the emails subject looks something like "??????????".

    Its probably becuase somehow it is not encoded. Surely emails in
    chinese with subject also in chinese can be sent. Any help/hints will
    be appreciated greatly.

    Below is a snippet of the SendMail function:

    Function SendMail(sSubject, sMessage, sEmail, sFromEmail)
    Dim oCdo
    Dim sBodyText

    On Error Resume Next

    'validate input...
    If( IsNull(sEmail) or Len(sEmail) = 0 or IsNull(sFromEmail) or Len
    (sFromEmail) = 0 )Then
    SendMail = False
    Exit Function
    end if

    Set oCdo = Server.CreateObject("CDONTS.NewMail")

    If Not IsObject(oCdo) Then
    SendMail = False
    Set oCdo = Nothing
    Exit Function
    End If

    oCdo.To = sEmail
    oCdo.From = sFromEmail
    oCdo.Subject = sSubject 'THIS NEEDS PROPER ENCODING
    oCdo.BodyFormat = 0
    oCdo.MailFormat = 0
    oCdo.SetLocaleIDs(AFFILIATE_CODEPAGE)
    oCdo.Body = sMessage
    Call oCdo.Send()
    Set oCdo = Nothing

    If Err.number <> 0 Then
    SendMail = False
    Else
    SendMail = True
    End If
    End Function


    /Saya
    Saya, Jun 3, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. maher
    Replies:
    0
    Views:
    136
    maher
    Jul 8, 2003
  2. Steve

    CDONTS.NewMail - not working...!

    Steve, Aug 22, 2003, in forum: ASP General
    Replies:
    4
    Views:
    179
    Aaron Bertrand - MVP
    Aug 22, 2003
  3. George Viveiros

    Send Method (CDONTS NewMail Object)

    George Viveiros, Nov 17, 2003, in forum: ASP General
    Replies:
    6
    Views:
    122
    Ray at
    Nov 18, 2003
  4. aa
    Replies:
    1
    Views:
    144
    [ + 2 0 r p 3 ]
    May 13, 2004
  5. Paul
    Replies:
    3
    Views:
    380
    Dr. Know
    Jan 25, 2005
Loading...

Share This Page