Esoterica.gr
Starting Member
Greece
43 Posts |
Posted - 07 June 2002 : 22:39:25
|
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 ...
< |
|