Wrox Programmer Forums
|
Classic ASP Professional For advanced coder questions in ASP 3. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 13th, 2012, 09:31 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default Sending mail on Windows 7 using CDOSYS

good day all

Having just moved to a new windows 7 machine using classic ASP I have a very annoying 'The transport failed to connect to the server.' on the .Send line of my mail code.

I am coding locally on a domain using a valid SMTP address. I have completely eliminated the code, domain/SMTP IP etc as the issue because the page works fine without delay on my XP machine.

The first time the page ran locally on Win 7 it did run however it hung for a good 20-30 seconds and did send the mail. When i run the page for the second time and everytime thereafter I get the same hang and the 'The transport failed to connect to the server.' on the .Send line.

My research so far has found others with the same behavior however no solutions. im figuring there is an IIS setting I need to change???

Help......TYIA
__________________
Wind is your friend
Matt
 
Old February 14th, 2012, 10:16 AM
Authorized User
 
Join Date: Jan 2011
Posts: 86
Thanks: 1
Thanked 12 Times in 12 Posts
Default

HI,

it might not be the issue your having but depending on what you use to send your mail, you might need to install CDO 1.2.1 yourselves...

See here for download: http://www.microsoft.com/download/en...s.aspx?id=3671
 
Old February 14th, 2012, 05:28 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

Thank you for your input however that is not going to help, it appears to be a download for Exchange communicate with outlook. BTW to answer your question, I am using CDOSYS...
__________________
Wind is your friend
Matt
 
Old March 2nd, 2012, 06:19 AM
Authorized User
 
Join Date: Mar 2012
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Dont use cdosys, change to cdonts its your best move, do something like this and you will be fine.

HTML Code:
if Request.querystring("actnow")="gonow" then

sch = "http://schemas.microsoft.com/cdo/configuration/" 

Set cdoConfig = Server.CreateObject("CDO.Configuration") 

cdoConfig.Fields.Item(sch & "sendusing") = 2 
cdoConfig.Fields.Item(sch & "smtpauthenticate") = 1 
cdoConfig.Fields.Item(sch & "smtpusessl") = True
cdoConfig.Fields.Item(sch & "smtpserverport") = 465
cdoConfig.Fields.Item(sch & "smtpserver") = "smtp.gmail.com" 
cdoConfig.Fields.Item(sch & "sendusername") = "youremail@gmail.com" 
cdoConfig.Fields.Item(sch & "sendpassword") = "yourpassword" 
cdoConfig.fields.update 

Set cdoMessage = Server.CreateObject("CDO.Message") 
Set cdoMessage.Configuration = cdoConfig 

cdoMessage.From = "youremail@gmail.com"
cdoMessage.To = sTo
cdoMessage.Subject = sSubject 
cdoMessage.TextBody = stxtBody
x = cdoMessage.Send 

if x > 0 then

        Response.Write x
        Response.End
        else
if Request.querystring("var_mal")="pass" then
response.Write("<script>alert('E-mail sent sussesfully!');location.href='index.asp'</script>")
else
response.Write("<script>alert('E-mail sent sussesfully!');location.href='javascript:history.go(-1)'</script>")
end if


End if
set session("e")= Nothing
Set cdoMessage = Nothing 
Set cdoConfig = Nothing


end if
At least this is my opinion, hope it help you in some way.
 
Old March 4th, 2012, 06:01 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

Razstec -Thanks for your input however cdonts depreciated. It has not been reccomended for a fair while now, years in fact......So much so windows dont even ship the cdonts.dll with thier OS anymore. I believe they stopped when they shipped Windows 2003. I am aware the dll can be installed.......but not everyone owns, and has full admin rights to their servers.....

If you do some research you will find cdosys is the recommended mail method for classic ASP
__________________
Wind is your friend
Matt
 
Old March 6th, 2012, 07:39 AM
Authorized User
 
Join Date: Mar 2012
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Im sorry my example was cdosys im always calling cdonts to ccdosys, sorry.

my example is cdosys, check it out.
 
Old March 6th, 2012, 05:19 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

No need to apologize, thank you for your time and effort. If you read my post's subject you will see I am already using CDOSYS, also if you read the actual post you will see there is no issue with the mail code as it did fire and send successfully. I suspect its a Windows 7 /IIS 7+ setting/issue

A shame good ole classic ASP isnt so widely used anymore.......someone must have had this issue of CDOSYS not working no Win 7/IIS out of the box (with all the relevent enable classic ASP options on)
__________________
Wind is your friend
Matt
 
Old March 7th, 2012, 05:07 AM
Authorized User
 
Join Date: Mar 2012
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

i actually test my pages on a windows 7 iis6 machine and it works fine, maybe you should increase your delay time....

im no expert but theres no harm in trying that.





Similar Threads
Thread Thread Starter Forum Replies Last Post
failure sending e-mail (os is windows 7 and server is iis7) ruslandag ASP.NET 3.5 Professionals 2 September 17th, 2009 01:13 PM
Sending Mail Using CDOSYS in ASP artarasan Classic ASP Basics 1 May 12th, 2008 06:11 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.