View Single Post
  #2 (permalink)  
Old 07-30-2007, 12:54 AM
oxygen oxygen is offline
D-Web Architect
 
Join Date: Jun 2007
Posts: 633
oxygen is on a distinguished road
Thumbs up Re: 1. Do we have facilities to send SMS thru asp?

Hi Buddy,


Yes, you can send SMS thru your ASP Page.

Code:
<html>
  <HEAD>
    <BODY>

      <p>Sending XML <br>
		
	<%  
	    
'========================================================
'This code requires a user account with http://www.2sms.com
'Register now for a free no obligation trial of the service
'Simply call this method with the username and password you
'choose on the site and include a message and destination
'
'REQUIRES: Microsoft's XML Parser
'========================================================


	    'Insert your username and password (as used to log on to the website) here

	    	UserName = "USN"
	    	PassWord = "PWD"
		Message = "Testing SMS"
		Destination = "447788123123"
	

	    'sample of how to retrieves the message and number from a previous posting page

	    	'Message = request.form("message")
	    	'Destination = request.form("number")



	   
	    'form up the first segment of XML 

		strfirstpart= "<?xml version=" & Chr(34) & "1.0" & Chr(34) & "?> " & _
		"<Request xmlns:xsi=" & Chr(34) & "http://www.w3.org/2001/XMLSchema-instance" & Chr(34) & " 

xsi:noNamespaceSchemaLocation=" & Chr(34) & "http://schema.2sms.com/1.0/0410_RequestSendMessage.xsd" & Chr(34) & " Version = " & 

Chr(34) & "1.0" & Chr(34) & ">" & _
		"<Identification>" & _
		"<UserID><![CDATA[" & username & "]]></UserID>" & _
		"<Password>" & password & "</Password>" & _
		"</Identification>" & _
		"<Service>" & _
	    	"<ServiceName>SendMessage</ServiceName>" & _
    		"<ServiceDetail>"
 
	    
	    '
	    'Form up the middle of the XML. To send multiple messages within one document insert 
	    'multiple SingleMessage nodes (eg loop through the code below to add the strMidPart string 
	    'several times). Your document may contain up to 500 SingleMessage nodes.
	    '
	    
	    strMidPart = strMidPart +"<SingleMessage><Destination>" & Destination & "</Destination><Text><![CDATA[" & Message & 

"]]></Text></SingleMessage>"
	    
	    'form up the bottom of the xml document

	    strEndPart = 	"</ServiceDetail>" & _
			    	"</Service>" & _
				"</Request>"

	    'Concatonate all 3 strings to form complete xml document for sending
	    XMLstring = strFirstPart + StrMidPart + strEndPart
	    
	%>

	outgoing XML 
	<textarea name="textfield" cols="50" rows="10"><%=XMLstring%>
This code shows how to use the XML Interface provided by http://www.2sms.com to sedn text messages from within an ASP page using VBScript. This code requires a username from www.2sms.com - register now for a free trial account with no obligation. It also relies on the Microsoft XML Parser.

Hope Usefull.
__________________
The OXYGEN
Delivers edgy, intelligent Technology to all...
Reply With Quote