By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,868 Members | 1,974 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,868 IT Pros & Developers. It's quick & easy.

The transport failed to connect to the server. ASP, VBScript

P: 3
Hi,

I am a newbie to ASP and VBScript. I have a bizzare error that I have been trying to trouble shoot for about 2 days now. Essentially I have been jumping from one website to another to try and solve the problem.

Problem Description:
I am trying to use VBScript To Send Email Using CDO and this is code I have for it (with the credentials filtered)

Expand|Select|Wrap|Line Numbers
  1.  
  2. sub request_recommendation(ID)
  3.  
  4.     insert_recommend_request(ID)
  5.     dim cname
  6.     cname = get_reference(request.form("csmp_id"))
  7.     dim strSubject, emailText
  8.  
  9.     strSubject = "Recommendationp"
  10.     emailText = "<b> " & cname & " is testing this email functionality.<br/>"
  11.  
  12.     'Create the mail object
  13.     Set objMessage = Server.CreateObject("CDO.message")      
  14.     objMessage.TO = request.form("email")  
  15.     objMessage.From = "myusername@mymail.com"
  16.     objMessage.Subject = strSubject   ' Specify the subject line
  17.     objMessage.htmlBody =  emailText
  18.  
  19.     'Configs
  20.     objMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing")= 2
  21.     objMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp-server.com"
  22.     objMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = cdoBasic
  23.     objMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") = "myusername@mymail.com"
  24.     objMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "mypassword"    
  25.     objMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") =25 
  26.     objMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False
  27.     objMessage.Configuration.Fields.Update
  28.  
  29.     'Enable send
  30.     ON ERROR RESUME NEXT
  31.     objMessage.Send
  32.  
  33.     set objMessage = nothing
  34. end sub    
  35.  
When this function is executed (called from a view) I am getting this error: "The transport failed to connect to the server." The odd thing is that this same code was working perfectly about a week ago but this error started occurring 2 days ago. I have double checked the code for any typos but I don't see anything wrong with it.

Someone mentioned that this may be due to a network problem. "They suggested checking to ensure the server System.Web.Mail is executing and can connect to the mail server. Because sometimes firewalls or proxy servers can get in the way."

Is anyone familiar with:
1)How to check if the server is executing and connecting to my mail server.
2) How to check if firewalls or proxy servers are getting in the way.

Detailed steps on how to carry out these checks will be greatly appreciated because I am not sure what the problem is and I am speculating that this may be the issue.

Any other suggestions may be helpful too but YES I have looked up a lot the forums that google returns and they haven't been helpful so far.

Thanks
Jan 27 '12 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.