SMS Messaging Reliability Issue

Posted on 2012-09-17
Last Modified: 2012-09-28
I have an sms system in my web site that allows my users to text each other.  It has similar issues to my email system (I am not intending to double-post...I know these ideas are related but I was thinking they would be different enough to justify separate posts).  There are more 500 errors than I would like to see.  Here is my code...any feedback would be much appreciated.

	Set cdoConfig = CreateObject("CDO.Configuration")
	With cdoConfig.Fields
		.Item(cdoSendUsingMethod) = cdoSendUsingPort
		.Item(cdoSMTPServer) = "xxx"
		.Item(cdoSMTPAuthenticate) = 1
		.Item ("") = 25
		.Item(cdoSendUsername) = "xxx"
		.Item(cdoSendPassword) = "xxx"
	End With
	Set cdoMessage = Server.CreateObject("CDO.Message")
	Set cdoMessage.Configuration = cdoConfig

	'first send to head coach
	If Not CStr(lCoachProvider) & "" = "" Then
		With cdoMessage
			.From = sMyNumber & GetSendURL(lMyProvider)
			.To = sCoachNumber & GetSendURL(lCoachProvider)
			.TextBody = sMsg
		End With
	End If
	'now send to designated recipients
	For i = 0 To UBound(Recips, 2) - 1
		If Not CStr(Recips(1, i)) & "" = "" Then
			With cdoMessage
				.From = sMyNumber & GetSendURL(lMyProvider)
				.To = Recips(2, i) & GetSendURL(Recips(1, i))
				.TextBody = sMsg
			End With
		End If
	Set cdoMessage = Nothing
End If
Private Sub GetRecip(lMyID, sMyRole, sMyLevel)
	'currently only being used for the participants gotten from the roster groups...could also be used to get staff, contacts and assts as we did on the 
	'txt_msg page we will see which approach works better
	bIsRecip = False
	lThisProvider = 0
	sThisNumber = vbNullString
	Set rs2 = Server.CreateObject("ADODB.Recordset")
	sql2 = "SELECT Provider, Number FROM MyWireless WHERE MyID = " & lMyID & " AND MyRole = 'Participant'"
	rs2.Open sql2, conn, 1, 2
	If rs2.RecordCount > 0 Then
		If Not rs2(0).Value & "" = "" Then
			If Not rs2(1).Value & "" = "" Then 
				lThisProvider = rs2(0).Value
				sThisNumber = rs2(1).Value
				bIsRecip = True
			End If
		End If
	End If
	Set rs2 = Nothing
End Sub

Private Function GetSendURL(lProviderID)
	If Not CStr(lProviderID) & "" = ""  Then
		Set rs = Server.CreateObject("ADODB.Recordset")
		sql = "SELECT SendURL FROM WrlsPrvdr WHERE WrlsPrvdrID = " & lProviderID
		rs.Open sql, conn, 1, 2
		If rs.RecordCount > 0 Then GetSendURL = rs(0).Value
		Set rs = Nothing
	End If
End Function

Open in new window

Question by:Bob Schneider
    LVL 30

    Accepted Solution

    Have you checked the web server logs for more details on the HTTP 500 errors? How many concurrent users do you have on this site at the time you start getting HTTP 500 errors?

    Author Comment

    by:Bob Schneider
    I get pretty accurate error reporting but it seems like I have cleaned up the code on those and I still get errors...mostly "no recipient found" issues.  Just wondering if there is something in my code that could be changed to:
    1) better accommodate user errors, and
    2) keep the thing from completely crashing in the middle of a send if a single error appears.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Suggested Solutions

    Title # Comments Views Activity
    IIS 8.5 3 26
    SMS AddAttachment Protocol Error Classic ASP 10 28
    Configure IIS to process JSON 10 45
    XML Parsing Classic ASP 5 25
    I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
    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…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    760 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

    15 Experts available now in Live!

    Get 1:1 Help Now