hi all...
i need some assistance on CDO Object....I m designing a suggestion box to be placed on company's intranet. And in relation, i've two questions related to sending
mails from an asp page.
The first one is how can i send anonymous emails from an asp page.
The second one is currently i m running Win XP, so to send mails from asp page i need to use CDO Object, and here
comes the problem. While trying to load the page in browser, it displays the following error message:
Technical Information (for support personnel)
Error Type:
(0x80040211)
/new/mailsugg.asp, line 36
Any suggestions on how to come up with a solution for these problems?
[Plz don't suggest to use CDONTS instead of CDO object...i need to get it done using CDO object]
Here is the code that i m trying out......
<!--METADATA TYPE="typelib" UUID="CD000000-8B95-11D1-82DB-00C04FB1625D" NAME="CDO for Windows 2000 Library" -->
<!--METADATA TYPE="typelib" UUID="00000205-0000-0010-8000-00AA006D2EA4" NAME="ADODB Type Library" -->
<%
'Declare local variables to hold the data from the Input form page "suggbox".
Dim strFrom 'String for sender
Dim strBody 'String for body
Dim objMail 'The CDO object
'Read in the values passed from previous page
strFrom = Request.Form("From")
strBody = Request.Form("SuggBody")
' Create an instance of the NewMail object.
Set ObjMail = Server.CreateObject("CDO.Message")
Set objConfig = CreateObject("CDO.Configuration")
'Configuration:
objConfig.Fields(cdoSendUsingMethod) = cdoSendUsingPort
objConfig.Fields(cdoSMTPServer) = "localhost"
objConfig.Fields(cdoSMTPServerPort) = 25
objConfig.Fields(cdoSMTPAuthenticate) = cdoBasic
'Update configuration
objConfig.Fields.Update
Set objMail.Configuration = objConfig
' Set the properties of the object
objMail.From = StrFrom
objMail.To = "myemail@mydomain.com"
objMail.Subject = "Online Suggestion Box - " + strFrom
objMail.HTMLBody = strBody
'objCDOMail.Importance = 1 '(0=Low, 1=Normal, 2=High)
' Send the message!
objMail.Send
' Set the object to nothing because it immediately becomes
' invalid after calling the Send method + it clears it out of the Server's Memory.
Set objMail = Nothing
Set objConfig = Nothing
%>
i need some assistance on CDO Object....I m designing a suggestion box to be placed on company's intranet. And in relation, i've two questions related to sending
mails from an asp page.
The first one is how can i send anonymous emails from an asp page.
The second one is currently i m running Win XP, so to send mails from asp page i need to use CDO Object, and here
comes the problem. While trying to load the page in browser, it displays the following error message:
Technical Information (for support personnel)
Error Type:
(0x80040211)
/new/mailsugg.asp, line 36
Any suggestions on how to come up with a solution for these problems?
[Plz don't suggest to use CDONTS instead of CDO object...i need to get it done using CDO object]
Here is the code that i m trying out......
<!--METADATA TYPE="typelib" UUID="CD000000-8B95-11D1-82DB-00C04FB1625D" NAME="CDO for Windows 2000 Library" -->
<!--METADATA TYPE="typelib" UUID="00000205-0000-0010-8000-00AA006D2EA4" NAME="ADODB Type Library" -->
<%
'Declare local variables to hold the data from the Input form page "suggbox".
Dim strFrom 'String for sender
Dim strBody 'String for body
Dim objMail 'The CDO object
'Read in the values passed from previous page
strFrom = Request.Form("From")
strBody = Request.Form("SuggBody")
' Create an instance of the NewMail object.
Set ObjMail = Server.CreateObject("CDO.Message")
Set objConfig = CreateObject("CDO.Configuration")
'Configuration:
objConfig.Fields(cdoSendUsingMethod) = cdoSendUsingPort
objConfig.Fields(cdoSMTPServer) = "localhost"
objConfig.Fields(cdoSMTPServerPort) = 25
objConfig.Fields(cdoSMTPAuthenticate) = cdoBasic
'Update configuration
objConfig.Fields.Update
Set objMail.Configuration = objConfig
' Set the properties of the object
objMail.From = StrFrom
objMail.To = "myemail@mydomain.com"
objMail.Subject = "Online Suggestion Box - " + strFrom
objMail.HTMLBody = strBody
'objCDOMail.Importance = 1 '(0=Low, 1=Normal, 2=High)
' Send the message!
objMail.Send
' Set the object to nothing because it immediately becomes
' invalid after calling the Send method + it clears it out of the Server's Memory.
Set objMail = Nothing
Set objConfig = Nothing
%>