<% dim act : act=trim(request.querystring("do")) if act="send" then msgname=FormEncode(request.form("msgname")) msgemail=FormEncode(request.form("msgemail")) msgtel=FormEncode(request.form("msgtel")) msgcont=FormEncode(request.form("msgcont")) call checknull(0,msgname,"姓名不能为空!","javascript:window.history.back();") call checklen(0,0,msgname,20,"姓名长度必须为20个字符以内!","javascript:window.history.back();") call checknull(0,msgtel,"联系电话不能为空!","javascript:window.history.back();") if checknull(1,msgtel,"","")=1 then call checklen(0,0,msgtel,12,"联系电话长度必须为12个字符以内!","javascript:window.history.back();") end if call checknull(0,msgcont,"说明内容不能为空!","javascript:window.history.back();") call checklen(0,0,msgcont,400,"说明内容已超过400个字符!","javascript:window.history.back();") dim send_email,send_title,send_body,return_send_email send_email= email send_title= webname &"【在线留言】" send_body=send_body & "留言时间:" & now() & "
" send_body=send_body & "留言IP:" & request.servervariables("REMOTE_ADDR") & "
" send_body=send_body & "姓名:" & server.HTMLEncode(msgname) & "
" send_body=send_body & "联系电话:" & server.HTMLEncode(msgtel) & "
" send_body=send_body & "地址:" & server.HTMLEncode(msgadd) & "
" send_body=send_body & "留言内容:
" & replacebr(server.HTMLEncode(msgcont)) & "
" return_send_email=gw_send_email(send_email,send_title,send_body) if return_send_email=true then call alert("留言发送成功!","?") else call alert("错误:留言发送失败!","javascript:window.history.back();") end if end if %>