
July 14th, 2009, 11:40 PM
|
 |
|
|
Join Date: Jul 2006
Location: New Springfield, OH
|
|
You need to disable friendly HTTP error messages on your system so that you can see the actual underlying error. Disable Friendly HTTP Error Messages in Internet Explorer- Open Internet Explorer and choose Internet Options... from the Tools menu.
- On the Advanced tab, under the Browsing section, click to clear the Show friendly HTTP error messages check box, and then click OK.
- Close the browser.
On the surface, your code looks ok, except that you're using a constant that isn't defined anywhere. If your ASP page does not have META information included for the CDO.Message object, the constant cdoSendUsingPort does not exists and will throw a runtime error. You can either define it, or add the type library information to gain access to enumerated constants.
Defining the constant:
asp Code:
Original
- asp Code |
|
|
<% Const cdoSendUsingPort = 2 Set oMail = Server.CreateObject("CDO.Message") Set iConf = Server.CreateObject("CDO.Configuration") Set Flds = iConf.Fields iConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort iConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.btconnect.com" iConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10 iConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 iConf.Fields.Update Set oMail.Configuration = iConf oMail.To = "kudutravel@btconnect.com" oMail.From = "kudutravel@btconnect.com" oMail.Subject = "Test" oMail.HTMLBody = "Test Message" oMail.Send Set iConf = Nothing Set Flds = Nothing %>
Including the type library information:
asp Code:
Original
- asp Code |
|
|
<% <!-- METADATA TYPE="typelib" UUID="CD000000-8B95-11D1-82DB-00C04FB1625D" NAME="CDO for Windows 2000 Library" --> Set oMail = Server.CreateObject("CDO.Message") Set iConf = Server.CreateObject("CDO.Configuration") Set Flds = iConf.Fields iConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort iConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.btconnect.com" iConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10 iConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 iConf.Fields.Update Set oMail.Configuration = iConf oMail.To = "kudutravel@btconnect.com" oMail.From = "kudutravel@btconnect.com" oMail.Subject = "Test" oMail.HTMLBody = "Test Message" oMail.Send Set iConf = Nothing Set Flds = Nothing %>
|