<% '------------------------------------------------------------------------------------------- ' ASP SCRIPT FOR SMS GATEWAY ' (c) 2001-2008 Digitel Mobile Srl ' all rights reserved ' last update: 23 April 2008 ' Requires MSXML2 '------------------------------------------------------------------------------------------- ' +OK Credit SMS accepted by SMS Server. It return the credit charged and SMS numbers ready to deliver. ' -ERR 100 Syntax/System Error ' -ERR 99 Credit Not Available ' -ERR 98 Login Failure ' -ERR 97 Gateway Error ' -ERR 96 Country Code Not Valid ' -ERR 95 Gsm Code Not Valid ' -ERR 94 Phone Number/Recipients Not Valid ' -ERR 93 SMS Data Not Valid ' -ERR 92 Data/Time Not Valid ' -ERR 91 Country Code or/and Gsm Code Not Available ' -ERR 90 Network Barred ' -ERR 89 Account Blocked ' -ERR 88 SMS Not Recognized ' -ERR 87 IP Address Blocked By Account ' -ERR 86 Recipient Blocked By Account ' -ERR 85 IP Address Not Authorized ' -ERR 84 Sender Not Valid ' -ERR 83 Bad Request Account = "xxxxxxxxx" ' Mandatory Max 20 Bytes String Username of customer account Password = "yyyyyyyy" ' Mandatory Max 20 Bytes String Password of customer account Sender = "testSMS" ' Mandatory Max 16 Digits or 11 characters alpahnumeric Originator Recipients = 2 ' Mandatory Max 2 Digits Integer: 1 to 99 Number of recipients to which sending PhoneNumbers = "+39123456789,+44123456789" ' Mandatory Max 16384 Bytes List of one or several recipient phone number to receive the SMS (separated by commas) SMSData = "This is a test message" ' Mandatory Max 4096 Bytes String SMS Message SMSType = "" ' Optional Max 3 Bytes String Type of message SMSDateTime = "25-Dec-2009 02:00:00 PM" ' Optional Max 30 Bytes Date and Time Desired deferred delivery date and time SMSTest = True ' Optional Boolean (True or False) Indicates "test" mode UDH = "" ' Optional Max 400 Bytes STRING User Data Header DCS = "" ' Optional Max 2 Bytes Hex Data Coding Scheme DeliveryRequest = 1 ' Optional Max 1 Digit Integer Delivery request on GSM (check the networks available) Notification = "mailto:youremail@yourdomain.xxx" ' Optional Max 98 Bytes String Allow to send notification to email address or towards a script via Http SmsValidity = "" ' Optional Max 4 Digits Numeric Validity Period SmsRef = "1000012345" ' Optional Max 20 Bytes String User Id Reference PhoneNumbers = Replace (PhoneNumbers, "%", "%25") PhoneNumbers = Replace (PhoneNumbers, "=", "%3D") PhoneNumbers = Replace (PhoneNumbers, "&", "%26") PhoneNumbers = Replace (PhoneNumbers, "#", "%23") PhoneNumbers = Replace (PhoneNumbers, "+", "%2B") PhoneNumbers = Replace (PhoneNumbers, " ", "%20") Sender = Replace (Sender, "%", "%25") Sender = Replace (Sender, "=", "%3D") Sender = Replace (Sender, "&", "%26") Sender = Replace (Sender, "#", "%23") Sender = Replace (Sender, "+", "%2B") Sender = Replace (Sender, " ", "%20") SMSData = Replace (SMSData, "%", "%25") SMSData = Replace (SMSData, "=", "%3D") SMSData = Replace (SMSData, "&", "%26") SMSData = Replace (SMSData, "#", "%23") SMSData = Replace (SMSData, "+", "%2B") SMSData = Replace (SMSData, " ", "%20") Notification = Replace (Notification, "%", "%25") Notification = Replace (Notification, "=", "%3D") Notification = Replace (Notification, "&", "%26") Notification = Replace (Notification, "#", "%23") Notification = Replace (Notification, "+", "%2B") Notification = Replace (Notification, " ", "%20") SMSDateTime = Replace (SMSDateTime, "%", "%25") SMSDateTime = Replace (SMSDateTime, "=", "%3D") SMSDateTime = Replace (SMSDateTime, "&", "%26") SMSDateTime = Replace (SMSDateTime, "#", "%23") SMSDateTime = Replace (SMSDateTime, "+", "%2B") SMSDateTime = Replace (SMSDateTime, " ", "%20") SmsRef = Replace (SmsRef, "%", "%25") SmsRef = Replace (SmsRef, "=", "%3D") SmsRef = Replace (SmsRef, "&", "%26") SmsRef = Replace (SmsRef, "#", "%23") SmsRef = Replace (SmsRef, "+", "%2B") SmsRef = Replace (SmsRef, " ", "%20") StringHttpPost = "" StringHttpPost = StringHttpPost & "Account=" & Account & "&Password=" & Password & "&SMSTest=" & SMSTest StringHttpPost = StringHttpPost & "&Sender=" & Sender & "&SMSData=" & SMSData & "&UDH=" & UDH StringHttpPost = StringHttpPost & "&Recipients=" & Recipients & "&PhoneNumbers=" & PhoneNumbers & "&SMSDateTime=" & SMSDateTime StringHttpPost = StringHttpPost & "&SMSGateway= " & SMSGateway & "&NetworkCode=" & NetworkCode StringHttpPost = StringHttpPost & "&DeliveryRequest= " & DeliveryRequest & "&Notification=" & Notification StringHttpPost = StringHttpPost & "&SmsValidity= " & SmsValidity & "&SmsRef=" & SmsRef & "&SMSType=" & SMSType & "&DCS=" & DCS URL = "http://gateway.smsitaly.com/bulk/send.asp?" & StringHttpPost Set XML = Server.CreateObject("MSXML2.ServerXMLHTTP") XML.Open "GET", URL, False XML.Send Result = XML.responsetext Set XML = Nothing Response.write result %>