发邮件的asp(CDONTS.NewMail)(6)


    if err then
      SendMail=False
      err.Clear
    else
      SendMail=True
    end if
  end function

  if request.Form<>"" then
      mailTo=trim(Request.form("mailTo"))
      mailForm=trim(Request.form("email"))
      title=trim(Request.form("title"))
      content=""
      for each mailKey in Request.form
        content=content&"<br>" & mailKey & ":" & trim(Request.form(mailKey))
      next
  elseif request.QueryString<>"" then
      mailTo=trim(Request.QueryString("mailTo"))
      mailForm=trim(Request.QueryString("email"))
      title=trim(Request.QueryString("title"))
      content=""
      for each mailKey in Request.QueryString
        content=content&"<br>" & mailKey & ":" & trim(Request.QueryString(mailKey))
      next
  else
    response.Write("<script language=javascript>alert('请用正确的方式发送Email');window.close();</script>")
    response.end
  end if
'  response.Write(content)
'  response.End()
  pdSendMail=SendMail(mailTo,mailForm,title,content)
  if not pdSendMail then
    response.Write("<script language=javascript>alert('发送失败');window.close();</script>")
  else
    response.Write("<script language=javascript>alert('发送成功');window.close();</script>")
  end if
%>