日期:2014-05-17  浏览次数:21017 次

表单接受值错误,挺简单。大家帮下

红色代码部分有错误,大家帮找下
VB code
jami.asp

<%  
if request[color=#FF0000]("send_yn")="y" [/color]then
call send_mail
'response.end
end if
function send_mail()
on error resume next
set jmail= server.CreateObject ("jmail.message")
if err<>0 then
response.write"<script>alert('你的服务器未安装Jmail组件,发送失败')</script>"
response.end
end if

jmail.Silent = false
jmail.Charset = "gb2312"
JMail.ContentType = "text/html"


jmail.From = request("myEmail")
jmail.FromName = request("myName")'发件人名字
jmail.ReplyTo = request("myEmail")'回信地址
jmail.Subject = request("title")'标签
jmail.AddRecipient request("toEmail")'收件人
jmail.Body = request("content") '内容,tag标签转换
jmail.MailServerUserName = request("userName")
jmail.MailServerPassWord = request("passWord")

isgo = jmail.Send(request("smtpServer"))
if isgo then
msg="发送成功:"&request("toEmail")
else
msg = "发送失败:"&request("toEmail")
end if
jmail.Close
set jmail = nothing
response.write(msg)
end function
%>  

<form id="form1" name="form1" method="post" action="jmail.[color=#FF0000]asp?send_yn=y">[/color]  <p>我的名字:
  <input name="myName" type="text" id="myName" value="延钧" />
  <br />
  <br />
  我的邮箱:
  <input name="myEmail" type="text" id="myEmail" value="412045137@qq.com" />
  </p>
  <p>邮箱SMTP:
  <input name="smtpServer" type="text" id="smtpServer" value="smtp.qq.com" />
  </p>
  <p> 邮箱用户:  
  <input name="userName" type="text" id="userName" value="412045137" />
  </p>
  <p>
  邮箱密码:
  <input name="password" type="text" id="password" value="" />
  <br />   
  <br />
  </p>
  <p>接收邮箱:
  <input name="toEmail" type="text" id="toEmail" value="412045137@qq.com" />
</p>
  <p>邮件标题:
  <input name="title" type="text" id="title" value="测试" />
  </p>
  <p>
  邮件内容:
  <textarea name="content" id="content" cols="45" rows="5">jmail</textarea>
  </p>
  <p>
  <input type="submit" style="height:30px" name="button" id="button" value=" 发 送 " />
  <input name="send_yn" type="hidden" id="send_yn" value="y" />
  </p>
</form>


------解决方案--------------------
trim一下。
------解决方案--------------------
你有那个hidden field就不用在url里加变量。