 |
| 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
|
|
|
|

February 13th, 2012, 09:31 PM
|
|
Friend of Wrox
|
|
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
|
|
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
|
|

February 14th, 2012, 10:16 AM
|
|
Authorized User
|
|
Join Date: Jan 2011
Posts: 86
Thanks: 1
Thanked 12 Times in 12 Posts
|
|
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
|
|

February 14th, 2012, 05:28 PM
|
|
Friend of Wrox
|
|
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
|
|
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
|
|

March 2nd, 2012, 06:19 AM
|
|
Authorized User
|
|
Join Date: Mar 2012
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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") = "[email protected]"
cdoConfig.Fields.Item(sch & "sendpassword") = "yourpassword"
cdoConfig.fields.update
Set cdoMessage = Server.CreateObject("CDO.Message")
Set cdoMessage.Configuration = cdoConfig
cdoMessage.From = "[email protected]"
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.
|
|

March 4th, 2012, 06:01 PM
|
|
Friend of Wrox
|
|
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
|
|
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
|
|

March 6th, 2012, 07:39 AM
|
|
Authorized User
|
|
Join Date: Mar 2012
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Im sorry my example was cdosys im always calling cdonts to ccdosys, sorry.
my example is cdosys, check it out.
|
|

March 6th, 2012, 05:19 PM
|
|
Friend of Wrox
|
|
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
|
|
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
|
|

March 7th, 2012, 05:07 AM
|
|
Authorized User
|
|
Join Date: Mar 2012
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|
|
 |