CDONTs.Newmail object and the subject field value

S

Saya

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top