Solved

Beside Myself

Posted on 2013-06-26
14
299 Views
Last Modified: 2013-06-27
I keep getting sporadic "Transport can not connect to the server." messages when users send email through my server via classic asp web pages.  Please note that it does NOT happen all the time but often enough that we are frustrated.  We have increased our RAM and hard drive space but it is still happening.

Final note:  it did not appear to happen until my server host made a change to the email server that was being used for this process.  Can someone, anyone, please brainstorm any possible reasons why a SPORADIC problem like this might be happening.  It happens with bulk sends as well as individual emails.
0
Comment
Question by:Bob Schneider
  • 6
  • 5
  • 2
  • +1
14 Comments
 
LVL 52

Assisted Solution

by:Scott Fell, EE MVE
Scott Fell,  EE MVE earned 313 total points
ID: 39279310
There could be many reasons. I would ask your host.  But you if you can post your code, we can take a look.  

Things to try:
Using ssl?
Changing port from 25 to alternate as set by ISP
Changing pick up to local
0
 
LVL 52

Assisted Solution

by:Scott Fell, EE MVE
Scott Fell,  EE MVE earned 313 total points
ID: 39279317
Are you authenticating?
0
 

Author Comment

by:Bob Schneider
ID: 39279336
Here is my code:
%>
<!--#include file = "../../includes/cdo_connect.asp" -->
<%
	
			Set cdoMessage = CreateObject("CDO.Message")
			With cdoMessage
				Set .Configuration = cdoConfig
				.To = sPartEmail
				.From = Session("coach_email")
				.Subject = "Welcome to eTRaXC&reg; from Coach " & Session("coach_last")
				.TextBody = sMsg
				.Send
			End With
			Set cdoMessage = Nothing
			Set cdoConfig = Nothing

Open in new window


and here is the include:
<%
Set cdoConfig = CreateObject("CDO.Configuration")
With cdoConfig.Fields
    .Item(cdoSendUsingMethod) = cdoSendUsingPort
    .Item(cdoSMTPServer) = "mail.bhi.com"
'    .Item(cdoSMTPServer) = "smtp.gmail.com"
    .Item(cdoSMTPAuthenticate) = 1
'    .Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl")=true 
    .Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
    .Item(cdoSendUsername) = "xxx@blackhole.com"
    .Item(cdoSendPassword) = "xxx"
    .Update
End With
%>

Open in new window

0
 
LVL 52

Assisted Solution

by:Scott Fell, EE MVE
Scott Fell,  EE MVE earned 313 total points
ID: 39279452
I would check with your webhost as to what they suggest.  But for sendusing, I think changing to local may help.
http://msdn.microsoft.com/en-us/library/exchange/ms873037(v=exchg.65).aspx

Do they they have an alternative port to use instead of 25?

I see you are using a username and pass, but  not specifying authentication.
item.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = cdoBasic

I typically use this as my reference http://www.paulsadowski.com/wsh/cdo.htm
0
 
LVL 11

Assisted Solution

by:G_H
G_H earned 62 total points
ID: 39279881
As this is sporadic, rather than permanent, I suspect someone (either the WebHost or the EMail Server) has a limit on the number of email which can be sent from the website.

Ask both parties about any limits they may impose. FastHosts in the UK have limits:

10 in 30 seconds
30 in 5 minutes
??? in 15 minutes

This will cause exactly what you are describing.

GH
0
 

Author Comment

by:Bob Schneider
ID: 39280159
I appreciate the addressing of the sporadic nature of this but sometimes it is a single email by a single user that does not go through.  padas, I will look at your solutions of course but I am wondering why the things you are suggesting would contribute to the sporadic nature of this issue.

Again,  this began happening in January after a change was made by my web host...not sure what they changed and they insist that nothing they did could have caused this but it was fine before and it is not now.  I have been unable to glean anything from the Failed Request Logs.

In fact I think there WAS a limit issue that they resolved that seemed to help but it is still happening occasionally, and more than I can accept.

I appreciate the continued effort to help me on this.
0
 
LVL 52

Assisted Solution

by:Scott Fell, EE MVE
Scott Fell,  EE MVE earned 313 total points
ID: 39280231
>padas, I will look at your solutions of course but I am wondering why the things you are suggesting would contribute to the sporadic nature of this issue.

They are not contributing, but mitigating.

What probably happend is some update or security patch was introduced.  This is how I am set up and all works.  This is not an easy thing to target and you just need to try.

This type of error also suggests there is breakdown with the smtp server and if you are using.  In your code you show the server is either bhi or gmail.  I know gmail has limitations https://support.google.com/mail/answer/22839?hl=en that if exceeded will temporarily shut you out.  It looks like your code is using bhi and you should check with them.  It is rare shared hosts allow sending bulk mail and if they do can be strict.  If bhi is your webhost, then I am pretty sure sending via pickup instead of remote could fix the issue.    I have completely stopped using my dedicated and shared servers for sending email and only sent through 3rd party smtp services.  I would look at sendgrid or mandril. I know I have suggested this to you in the past.
0
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

Author Comment

by:Bob Schneider
ID: 39281258
Yeah padas I was kind of avoiding that major of a change but I may have to go there.  The gmail was commented out simply because I don't use it any more but wanted reference what I had tried.  The security patch is a logical suggestion but, again, the sporadic nature even with individual email sends is still puzzling.

Can you send me your code so I can modify mine?  I am not sure what you mean by "local".

I am going to try that first and then look into moving to a third party.  I will also implement your authentication suggestion:

 item.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = cdoBasic
0
 
LVL 82

Assisted Solution

by:hielo
hielo earned 125 total points
ID: 39281575
>> .Item(cdoSMTPServer) = "mail.bhi.com"
Instead of "mail.bhi.com", have you tried "localhost".

Alternatively, the actual IP address - in case the problem is with DNS:
.Item(cdoSMTPServer) = "216.185.192.6"  (or even "127.0.0.1" if the smtp server is on the same machine).

BTW, if it is on the same machine, and none of the suggestions above work, you might want to try using  the pickup directory option.
0
 

Author Comment

by:Bob Schneider
ID: 39282000
What do you mean "on the same machine"?  The web server is in one physical location, but it does contain the smtp service.  Is that what you mean?  Obviously the site users are at other physical locations.
0
 
LVL 52

Assisted Solution

by:Scott Fell, EE MVE
Scott Fell,  EE MVE earned 313 total points
ID: 39282058
When the webserver and email server are on the same machine you can use local pick up (cdoSendUsingPickup)  http://msdn.microsoft.com/en-us/library/exchange/ms873037(v=exchg.65).aspx
0
 
LVL 82

Accepted Solution

by:
hielo earned 125 total points
ID: 39282075
>>The web server is in one physical location, but it does contain the smtp service.  Is that what you mean?
Yes, when both the SMTP server (software) and the Web Server (software) are running on the same physical machine.  It is possiblie to have both of these server softwares running on separate physical machines.

If both of these server softwares are running on the same physical machine, then you should be able to use "localhost" or 127.0.0.1.

The reason for the IP suggestion is because a while back I had the need to use a server component (MSXML2.ServerXMLHTTP) to access a remote website from an asp script.  I too was getting sporadic results.  Changing the domain to an IP worked fine.  The problem seemed to be that the server sometimes could not resolve the domain to an IP.  Increasing the timeout did not solve the problem.  The site was on a shared hosting account and ultimately I was not able to find out what was the cause of the problem (considering I did not have access to investigate within the machine - Ex: Event Viewer) whenever I used the domain.  Ultimately my script worked, but only because I used the actual IP.
0
 

Author Comment

by:Bob Schneider
ID: 39282208
You folks are all incredibly helpful!  I will try to implement these suggestions and then, if that does not work, I will look into a third party solution.
0
 

Author Closing Comment

by:Bob Schneider
ID: 39282211
Incredibly good discussion.
0

Featured Post

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

Suggested Solutions

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Prologue It is often required to host multiple websites on a single instance of IIS, mostly in development environments instead of on production servers. I am sure it is not much a preferred solution on production servers but this is at least a pos…
This video teaches users how to migrate an existing Wordpress website to a new domain.
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now