Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 DEV-Group
 DEV Internationalization (v4)
 Case: Sending GREEK mails with CDOSYS succesful !!
 Forum Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Esoterica.gr
Starting Member

Greece
43 Posts

Posted - 07 June 2002 :  22:39:25  Show Profile  Visit Esoterica.gr's Homepage
Well hello everybody and especially bozden!!

Continuouing from a previous message "Outlook Express doesn't recognize greek codepage" http://forum.snitz.com/forum/topic.asp?TOPIC_ID=26244 I'm happy to say that i finally found a proper way to have the forums send mails properly formatted in Greek ISO codepage in the way totally recognisable by Outlook Express, both Subject and Body ! (i discovered the method some time ago but I haven't post it until now, so I'm sorry for the delay to anyone which has been seeking for such a solution for any related International problem) Please look into the previous message to understand the situation more clearly...

I'm using CDOSYS included in the new-mail-components pack that RichardKinser has provided on: http://forum.snitz.com/forum/topic.asp?TOPIC_ID=25984 (2 files: inc_mail.asp and admin_config_email.asp ). But the files don't work as is for international purposes (like sending Greek or other languages' messages). So here is the solution to any problem related:

1)The files need internationalization first: replace the strings with the proper fLang() calls.

2)The file inc_mail.asp requires some modification in the CDOSYS section to make it send mails properly formatted with non english encoding both in Subject and in the body of the message and in a way that the mail-client will recognize the codepage properly. My sugestion is this (for Charset = "iso-8859-7" - Greek ISO always):


case "cdosys"
Dim objNewMail
Dim iBp
Dim iBp1
Dim Flds
Dim Stm

Set iConf = Server.CreateObject ("CDO.Configuration")
Set Flds = iConf.Fields

'Set and update fields properties
Flds("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1
Flds("http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory") = "c:\xxxxx\mail-dir\Pickup"
Flds.Update

Set objNewMail = CreateObject("CDO.Message")
Set objNewMail.Configuration = iConf

Set iBp = objNewMail.BodyPart
Set iBp1 = iBp.AddBodyPart

iBp1.ContentMediaType = "text/plain"
iBp1.Charset = "iso-8859-7"

Set Stm = iBp1.GetEncodedContentStream
Stm.WriteText strMessage
Stm.Flush

Set Flds = iBp.Fields
Flds("urn:schemas:mailheader:content-type") = "multipart/alternative"
Flds("urn:schemas:mailheader:subject") = strSubject
Flds.Update

objNewMail.To = strRecipients
objNewMail.From = strSender
objNewMail.BodyPart.Charset = "iso-8859-7"
On Error Resume Next
objNewMail.Send
If Err <> 0 Then
Err_Msg = Err_Msg & "<li>" & fLang(strLangInc_Mail00010) & " " & Err.Description & "</li>"
End if
on error goto 0



Notice that you have to modify the line Flds("http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory") = "c:\xxxxx\mail-dir\Pickup" and provide the proper Pickup directory for your case.

Also don't forget to set the server url in your forums' admin options (provide the same directory in there, i don't think that it makes any difference as it is stated in inc_mail.asp but the field cannot be empty)

The CDOSYS method is very detailed (but complicated too) so it can provide a lot of functionality if someone can use it properly. The above solution needed a lot of testing and fine tuning to make it work and I found the multipart aproach with bodyparts the only that can do the job with the greek language. I suppose that it can work with other language codepages as well. You only have to insert the proper charset definition into the two places it is needed. (Also i think that the multipart/bodypart ierarchy could be suited for attachments too)

I hope I was a little useful ...

<

Esoterica.gr
Starting Member

Greece
43 Posts

Posted - 07 June 2002 :  22:54:23  Show Profile  Visit Esoterica.gr's Homepage
I noticed that in the v33_05 release (the newest one) of the forums' code the CDOSYS method is not included... Were there some problems detected;

<
Go to Top of Page
  Previous Topic Topic Next Topic  
 Forum Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.12 seconds. Powered By: Snitz Forums 2000 Version 3.4.07