CDONTs.Newmail object and the subject field value

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Saya

    CDONTs.Newmail object and the subject field value

    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(sSubje ct, sMessage, sEmail, sFromEmail)
    Dim oCdo
    Dim sBodyText

    On Error Resume Next

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

    Set oCdo = Server.CreateOb ject("CDONTS.Ne wMail")

    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.SetLocaleI Ds(AFFILIATE_CO DEPAGE)
    oCdo.Body = sMessage
    Call oCdo.Send()
    Set oCdo = Nothing

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


    /Saya
Working...