<input class='button' type="button" name="Submit" value="发送邮件" >
<input class='button' type="button" name="Submit" value="发送短信" >
需要改源码,可能要用到这两个文件
下面是发手机短信的文件,把表单指向这个文件就行
需要注册一个短信发送的账户
-
<%@LANGUAGE=" CODEPAGE="936"%>
- <!--#include file="../Conn.asp"-->
- <!--#include file="../KS_Cls/Kesion.CommonCls.asp"-->
- <!--#include file="../KS_Cls/Kesion.AdministratorCls.asp"-->
- <!--#include file="Include/Session.asp"-->
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
- <title>发送短信</title>
- <link href="Include/Admin_Style.CSS" rel="stylesheet" type="text/css" />
- </head>
- <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
- <%
- dim ComeUrl
- ComeUrl=Cstr(Request.ServerVariables("HTTP_REFERER"))
- If Trim(Request.Form("Submit"))="发送短信" Then
- mobiles=Trim(Request("mobiles"))
- message=Trim(Request("message"))
- '===================
- uid="*****" '账号(改成你自己的)
pwd="*****" '密码(改成你自己的)
- mobiles=mobiles '接收的号码post方式建议一次 5000号码之内
- message=message '短信内容 最大70个字符。
- '====================
- '=============作用把中文转为urlcode
- Function URLEncoding(vstrIn)
- strReturn = ""
- For i = 1 To Len(vstrIn)
- ThisChr = Mid(vStrIn,i,1)
- If Abs(Asc(ThisChr)) < &HFF Then
- strReturn = strReturn & ThisChr
- Else
- innerCode = Asc(ThisChr)
- If innerCode < 0 Then
- innerCode = innerCode + &H10000
- End If
- Hight8 = (innerCode And &HFF00)\ &HFF
- Low8 = innerCode And &HFF
- strReturn = strReturn & "%" & Hex(Hight8) & "%" & Hex(Low8)
- End If
- Next
- URLEncoding = strReturn
- End Function
- '================与网关通信过程
- function getHTTPPage(strurl,data)
- on error resume next
- set http = Server.CreateObject("Msxml2.XMLHTTP")
- http.Open "POST",strurl, false
- http.setRequestHeader "Content-type:", "text/xml;charset=GB2312"
- Http.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
- http.Send(data)
- getHTTPPage=http.ResponseText
- set http=nothing
- end function
url="http://service.winic.org:8009/sys_port/gateway/?"
- sdata=URLEncoding("id="&uid&"&pwd="&pwd&"&to="&mobiles&"&content="&message&"&time=")
-
- binfo=getHTTPPage(url,sdata) '发送并把结果赋给binfo
- str=binfo
- str=split(str,"/")
- for i=0 to ubound(str)
- str(i)=str(i)
- next
- select case str(0)
- case "000" cg="000"
- case "-01" cg="当前账号余额不足!"
- case "-02" cg="当前用户ID错误!"
- case "-04" cg="参数不够或参数内容的类型错误!"
- case "-12" cg="其它错误!"
- end select
sl=mid(str(1),6)
- ye=mid(str(3),8)
- xf=mid(str(2),13)
if cg="000" then
- Response.Write "<script>alert('本次成功发送"&sl&"条,消费"&xf&"元,余额"&ye&"元');location.href='"&ComeUrl&"';</script>"
- else
- Response.Write "<script>alert('发送错误!"&message&";location.href='"&ComeUrl&"';</script>"
- end if
- End If
- %>
- </body>
- </html>