IIS ASP - CDONTs.Newmail object and the subject field value

This is Interesting: Free IT Magazines  
Home > Archive > IIS ASP > June 2004 > CDONTs.Newmail object and the subject field value





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author CDONTs.Newmail object and the subject field value
Saya

2004-06-03, 10:51 am

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
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com