riadazad
02-04-2004, 04:45 AM
i have a problem with the cdo object while i am sending email from my classic asp form. as per discount asp.net's sample cdo.asp iam using the following codes in the page
Set Flds = objConfig.Fields
Flds.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
Flds.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost"
Flds.update
along with other necessary initialization of cdo.message and cdo.config, their sample(cdo.asp) works fine when i upload but my page (publicemail.asp)is not working.
can anybody please help me asap as my project is due soon. in fact if this part works then i will get data from a form and then send through.
here i attach my whole code of the page publicemail.asp
<%
'The header/footer for the email.
'Const strHeader = "Here are the results of the form:"
'Const strFooter = "Form mailer created by Metz development"
'Who does this go to?
'dim strTo = "rio682@yahoo.com"
'Dim strBody
'strBody = strHeader & vbCrLf & vbCrLf
'strBody = "test FORM: Riad Azad "
'strBody = strBody & vbCrLf & strFooter
set objConfig = createobjectt("cdo.configuration")
Set Flds = objConfig.Fields
Flds.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
Flds.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost"
Flds.update
'Time to send the email
'Dim objCDO
Set objCDO = createobject("cdo.message")
'Set objCDO = Server.CreateObject("CDONTS.NewMail")
Set objCDO.Configuration = objConfig
objCDO.To = "rio682@yahoo.com"
objCDO.From = "rio682@hotmail.com"
objCDO.Subject = "This is a sample email sent using CDO by Riad Azad"
objCDO.TextBody = "test FORM: Riad Azad "
objCDO.fields.update
objCDO.Send
'Response.Redirect("confirmation.html")
Response.write "Mail sent from Riad Azad..."
Set objCDO = Nothing
set objConfig = nothing
%>
Riad Azad
Set Flds = objConfig.Fields
Flds.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
Flds.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost"
Flds.update
along with other necessary initialization of cdo.message and cdo.config, their sample(cdo.asp) works fine when i upload but my page (publicemail.asp)is not working.
can anybody please help me asap as my project is due soon. in fact if this part works then i will get data from a form and then send through.
here i attach my whole code of the page publicemail.asp
<%
'The header/footer for the email.
'Const strHeader = "Here are the results of the form:"
'Const strFooter = "Form mailer created by Metz development"
'Who does this go to?
'dim strTo = "rio682@yahoo.com"
'Dim strBody
'strBody = strHeader & vbCrLf & vbCrLf
'strBody = "test FORM: Riad Azad "
'strBody = strBody & vbCrLf & strFooter
set objConfig = createobjectt("cdo.configuration")
Set Flds = objConfig.Fields
Flds.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
Flds.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost"
Flds.update
'Time to send the email
'Dim objCDO
Set objCDO = createobject("cdo.message")
'Set objCDO = Server.CreateObject("CDONTS.NewMail")
Set objCDO.Configuration = objConfig
objCDO.To = "rio682@yahoo.com"
objCDO.From = "rio682@hotmail.com"
objCDO.Subject = "This is a sample email sent using CDO by Riad Azad"
objCDO.TextBody = "test FORM: Riad Azad "
objCDO.fields.update
objCDO.Send
'Response.Redirect("confirmation.html")
Response.write "Mail sent from Riad Azad..."
Set objCDO = Nothing
set objConfig = nothing
%>
Riad Azad