Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CDONTS stopped working

Status
Not open for further replies.

Ricjd

Programmer
Sep 12, 2002
104
GB
since i have installed exchange CDONTS has stoppped working in ASP.
I was wondering if anyone knew why this is

Rick
 
First things would be to ask if you installed SP3 for Exchange. If you did, then it closed relay so normal CDONTS won't work without authentication. This was a fix in SP3 to keep the open relay from being abused. Most servers were blacklisted after being randomly tested for open relay and ISP's around the world were using those blacklists to block servers that had this problem to help cut down on spam.

Here is the solution if this is your problem; (took me a couple weeks to find this and all my site's forms were run with CDONTS)

You need the following code to process your CDONTS email request. Just copy and paste this into a new asp page and it will process the fields stated below from the form the same way unauthenticated CDONTS does.
==============================================

<%
Const cdoSendUsingMethod = &quot;Const cdoSendUsingPort = 2
Const cdoSMTPServer = &quot;Const cdoSMTPServerPort = &quot;Const cdoSMTPConnectionTimeout = &quot;Const cdoSMTPAuthenticate = &quot;Const cdoBasic = 1
Const cdoSendUserName = &quot;Const cdoSendPassword = &quot;
Dim objConfig ' As CDO.Configuration
Dim objMessage ' As CDO.Message
Dim Fields ' As ADODB.Fields

' Get a handle on the config object and it's fields
Set objConfig = Server.CreateObject(&quot;CDO.Configuration&quot;)
Set Fields = objConfig.Fields

' Set config fields we care about
With Fields
.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item(cdoSMTPServer) = &quot;yourserverhere&quot;
.Item(cdoSMTPServerPort) = 25
.Item(cdoSMTPConnectionTimeout) = 10
.Item(cdoSMTPAuthenticate) = cdoBasic
.Item(cdoSendUserName) = &quot;username&quot;
.Item(cdoSendPassword) = &quot;password&quot;

.Update
End With

Set objMessage = Server.CreateObject(&quot;CDO.Message&quot;)

Set objMessage.Configuration = objConfig

With objMessage
.To = request.form (&quot;recipient&quot;)
.From = request.form (&quot;name&quot;)
.From = request.form (&quot;email&quot;)
.Subject = &quot;your subject&quot;
.TextBody = request.form (&quot;message&quot;)
.Send
End With

Set Fields = Nothing
Set objMessage = Nothing
Set objConfig = Nothing
Response.Write (Thanks for using the form)
%>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top