Hi.
I am hosting a site with godaddy.com, & their shared windows hosting only supports cdonts & cdosys as mail objects.
I am trying to send a unucode message with cdosys (the message is in hebrew) to enable a contact form on my site and I get a variety of errors.
Finally I decided as a workaround to use filesystemobject to create a unicode html file and then load it using CreateMHTMLBody with the file name.
Now, the html file is created perfectly to my demand, but when I give the .send command I get the following:
"CDO.Message.1 error '80040212'
The transport lost its connection to the server.
[file path], line [line number]"
Please help me fix this.
here is my code:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<%
Dim fso, sndfile, ts
Set fso = CreateObject("Scripting.FileSystemObject")
Set sndfile = fso.GetFile(server.MapPath("sndmail.html"))
set ts = sndfile.OpenAsTextStream(2,-1)
ts.WriteLine ("<html>")
ts.WriteLine ("<head>")
ts.WriteLine ("<meta http-equiv=""Content-Type"" content=""text/html; charset=utf-8"" />")
ts.WriteLine ("<title>contact form</title>")
ts.WriteLine ("</head>")
ts.WriteLine ("<body style=""direction:rtl"">")
ts.WriteLine ("<table>")
ts.WriteLine (" <tr>")
ts.WriteLine (" <td>")
ts.WriteLine (" :")
ts.WriteLine (" </td>")
ts.WriteLine (" <td>")
ts.WriteLine (" " & Request.Form("fname"))
ts.WriteLine (" </td>")
ts.WriteLine (" </tr>")
ts.WriteLine (" <tr>")
ts.WriteLine (" <td>")
ts.WriteLine (" :")
ts.WriteLine (" </td>")
ts.WriteLine (" <td>")
ts.WriteLine (" " & Request.Form("phone"))
ts.WriteLine (" </td>")
ts.WriteLine (" </tr>")
ts.WriteLine (" <tr>")
ts.WriteLine (" <td>")
ts.WriteLine (" :")
ts.WriteLine (" </td>")
ts.WriteLine (" <td>")
ts.WriteLine (" " & Request.Form("cell"))
ts.WriteLine (" </td>")
ts.WriteLine (" </tr>")
ts.WriteLine (" <tr>")
ts.WriteLine (" <td>")
ts.WriteLine (" "" :")
ts.WriteLine (" </td>")
ts.WriteLine (" <td>")
ts.WriteLine (" <a href=""mailto:" & Request.Form("email") & """>" &_
Request.Form("email") & "</a>")
ts.WriteLine (" </td>")
ts.WriteLine (" </tr>")
ts.WriteLine (" <tr>")
ts.WriteLine (" <td valign=""top"">")
ts.WriteLine (" :")
ts.WriteLine (" </td>")
ts.WriteLine (" <td>")
ts.WriteLine (" " & replace(Request.Form("msg"), vbcrlf, "<br />"))
ts.WriteLine (" </td>")
ts.WriteLine (" </tr>")
ts.WriteLine ("</table>")
ts.WriteLine ("</body>")
ts.WriteLine ("</html>")
ts.close
set ts = nothing
set sndfile = nothing
set fso = nothing
Dim ObjSendMail, sch, cdoConfig
Set ObjSendMail = CreateObject("CDO.Message")
sch = "http://schemas.microsoft.com/cdo/configuration/"
Set cdoConfig = Server.CreateObject("CDO.Configuration")
With cdoConfig.Fields
.Item(sch & "sendusing") = 2 ' cdoSendUsingPort
.Item(sch & "smtpserver") = "relay-hosting.secureserver.net"
.update
End With
Set ObjSendMail.Configuration = cdoConfig
ObjSendMail.From = "from email" 'tommygordon.co.il
ObjSendMail.To = "to email"
ObjSendMail.Subject = "A message from a visitor on the website (zvitoren.com)"
ObjSendMail.CreateMHTMLBody "THE PATH TO sndmail.html"
ObjSendMail.Send
'Set ObjSendMail = Nothing
%>
</body>
</html>
Thanks, Tommy

unicode message with cdosys
explode
This is a bit beyond the scope of this forum, which focuses on HTML/CSS related apsects of web design, rather than ASP related issues. You may find a more appropriate forum here.
That said, I used a search engine and found this forum thread (on another site) that may or may not be useful. I can't vouch for it myself and am not implying any endorsement by linking to it. Hopefully, it will have useful hints; if not, there may be other articles on the web that do.
Hope this helps...
-- Lance