⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sendmail.asp

📁 科技网站ASP
💻 ASP
字号:
<%@ Language=VBScript.Encode %>
<%

Response.Buffer =true

dim element,mailContent,emailto,subject,thankurl,totalCount,JMail

dim intLoop,arrForm()

if Request.Form.Count=0 then
   Response.End 
end if

'--------------------------------------
'Function:      GetNum()
'Description:   得到str的编号
'---------------------------------------
Function GetNum(str)
 dim pos,lenth,num
 if Instr(str,"_")=0 then
    GetNum=0
    exit function
 else   
    pos=Instr(str,"_")
    lenth=len(str)-pos
    num=mid(str,pos+1,lenth)
    if IsNumeric(num)=false then
       Response.Write (str)
       Response.Write ("请确认此项的命名规则!")
          Response.End     
       end if   
    GetNum=cstr(num)
 end if   
End function

'--------------------------------------
'Function:      GetStr()
'Description:   得到str的字符串
'---------------------------------------
Function GetStr(str)
    dim pos,strTemp
 if Instr(str,"_")=0 then
    GetStr=""
    exit function
 else   
    pos=Instr(str,"_")
    strTemp=mid(str,1,pos-1)
    GetStr=cstr(strTemp)
 end if   
End function

'******************************************************
'Main Code Goes Here
'Create Date:2000.9.29
'Description:
'通过Input传递的Form项的Name后缀解决顺序排列混乱问题
'****************************************************** 

emailto    =   Request.Form ("emailto")
subject    =   Request.Form ("subject")
thankurl   =   Request.Form ("thankurl")

mailContent=""

redim arrForm((2*Request.Form.Count))
for each element in Request.Form
      if GetNum(cstr(element))<>0 then
           arrForm(cint(GetNum(element)))=element
      end if
next 

mailContent="<TABLE border=1 cellPadding=1 cellSpacing=1 width='75%'>"

for intLoop=1 to ubound(arrForm) 

   if arrForm(intLoop)<>"" then

   mailContent=mailContent+"<tr><td width='200'>"+cstr(GetStr(arrForm(intLoop)))+":</td><td width='200'>"+cstr(Request.Form(cstr(arrForm(intLoop))))+"&nbsp;</td></tr>"    

   end if
next  

mailContent=mailContent+"</table>"


set msg = Server.CreateOBject( "JMail.Message" )
msg.ContentType = "text/html"
msg.Charset = "GB2312" 
msg.Logging = true
msg.silent = true
msg.From = emailto
msg.FromName = emailto
msg.mailserverusername="sendmail"
msg.mailserverpassword="yingnetmail"
msg.AddRecipient emailto

msg.Subject = subject
msg.Body = mailContent

if not msg.Send("qingdaojob.com:25" ) then
	Response.write "<pre>" & msg.log & "</pre>"
else
	Response.Redirect (thankurl)
end if

set msg=nothing


%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -