关于表单提交问题(100分)

  • 主题发起人 主题发起人 gutian
  • 开始时间 开始时间
G

gutian

Unregistered / Unconfirmed
GUEST, unregistred user!
我想用如下代码实现邮件发送。但是点击发送后,不能取到提交的form中的元素值。为什么
<!--#include file="passinc.asp" -->

<% Response.Expires=0 %>
<%
test=request("EasyMail_From")
response.write test
if test<>"" then
response.write request("EasyMail_From")
response.write "hello"
response.end
end if
%>

<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" content="text/html; charset=gb_2312-80">
<TITLE>WebEasyMail</TITLE>
<style><!--
body,p,td,a{font-size:9pt;}

.textbox {
BORDER-BOTTOM:1px solid;
BORDER-LEFT:1px solid;
BORDER-RIGHT:1px solid;
BORDER-TOP:1px solid;
}
-->
</style>
</HEAD>

<script LANGUAGE=javascript>
<!--

function selectAdd(mode) {
if (mode == "To")
window.open("selectadd.asp?mode=To", "", "top=80; left=150; height=330,width=496,status=no,toolbar=no,menubar=no,location=no");
else if (mode == "Cc")
window.open("selectadd.asp?mode=Cc", "", "top=80; left=150; height=330,width=496,status=no,toolbar=no,menubar=no,location=no");
else if (mode == "Bcc")
window.open("selectadd.asp?mode=Bcc", "", "top=80; left=150; height=330,width=496,status=no,toolbar=no,menubar=no,location=no");
}


var count = 0

function showSave() {
f1.action = "savemail.asp";

sub(0);
}


function showSending() {
sub(1);
}

function sub(smode){
if (f1.EasyMail_To.value != "")
{
if (smode == 1)
sending.style.visibility="visible";
else
esave.style.visibility="visible";
f1.submit();

}
else
{
alert("请输入收件人地址");
f1.EasyMail_To.focus();
}
}

function getaddstr(thiscount){
var addstr;

addstr = "<table width='90%' border='1' bordercolorlight='#999999' align='center' bgcolor='#eeeeee' cellspacing='0' bordercolordark='#FFFFFF'>";
addstr = addstr + "<tr><td colspan='2'><input name='file'" + thiscount + "' type='file' size='70' class='textbox'></td></tr></table>";

return addstr;
}


function badd(){
if (count < 19)
{
var theObj
count = count + 1;
theObj = eval("document.all(/"add" + count + "/")");

theObj.innerHTML = getaddstr(count);
}
}
//-->
</script>

<BODY>
<br>
<div align="center"><a href="javascript:history.back();">返回</a></div>
<hr>
<FORM ENCTYPE="multipart/form-data" ACTION="writemail.asp" METHOD=POST NAME="f1">
<p>
<INPUT NAME="EasyMail_From" TYPE="hidden" value="<%= Session("wem")%>" maxlength="64">
</p>
<table width="90%" border="1" bgcolor="#eeeeee" bordercolorlight="#999999" bordercolordark="#FFFFFF" align="center" cellspacing="0">
<tr>
<td colspan="2">
<div align="center"></div>
<div align="center">如果需要输入多个邮件地址,请用","进行分割</div>
</td>
</tr>
<tr>
<td width="26%">
<div align="center"><a href="javascript:selectAdd('To')">收件人</a>:</div>
</td>
<td width="74%">
<input name="EasyMail_To" type="text" size="50" class='textbox'<%
if trim(request("addresssend")) <> "" then
response.write " value='" & mto & "'"
end if
%>>
</td>
</tr>
<tr>
<td width="26%">
<div align="center"><a href="javascript:selectAdd('Cc')">抄 送</a>:</div>
</td>
<td width="74%">
<input name="EasyMail_Cc" type="text" size="50" class='textbox'<%
if trim(request("addresssend")) <> "" then
response.write " value='" & mcc & "'"
end if
%>>
</td>
</tr>
<tr>
<td width="26%">
<div align="center"><a href="javascript:selectAdd('Bcc')">暗 送</a>:</div>
</td>
<td width="74%">
<input name="EasyMail_Bcc" type="text" size="50" class='textbox'<%
if trim(request("addresssend")) <> "" then
response.write " value='" & mbcc & "'"
end if
%>>
</td>
</tr>
<tr>
<td width="26%">
<div align="center">回复地址:</div>
</td>
<td width="74%">
<input name="EasyMail_BackAddress" type="text" size="50" class='textbox'>
</td>
</tr>
<tr>
<td width="26%">
<div align="center">主 题:</div>
</td>
<td width="74%">
<input name="EasyMail_Subject" type="text" size="50" class='textbox'>
</td>
</tr>
<tr>
<td colspan="2">
<div align="center">
<textarea name="EasyMail_Text" cols="80" rows="12" class='textbox'></textarea>
</div>
</td>
</tr>
<tr>
<td width="26%">
<div align="center">保存副本到发件箱:</div>
</td>
<td width="74%">
<input type="checkbox" name="EasyMail_SendBackup">
备份</td>
</tr>
<tr>
<td width="26%">
<div align="center">邮件等级:</div>
</td>
<td width="74%">
<select name="EasyMail_Priority" style="background-color: #EEF9FF; font-size: 9pt;">
<option value="Normal">普通邮件</option>
<option value="Low">慢件</option>
<option value="High">紧急邮件</option>
</select>
</td>
</tr>
<tr>
<td colspan="2" height="50">
<div align="center"></div>
<div align="center">
<input type="button" value=" 保 存 " onclick="javascript:showSave()">     
<input type="button" value=" 发 送 " onclick="javascript:showSending()">
</div>
</td>
</tr>
</table>
<p> </p>
<div id="sending" style="position:absolute; top:200; left:20; z-index:10; visibility:hidden"><TABLE WIDTH=100% BORDER=0 CELLSPACING=0 CELLPADDING=0><TR><td width=30%></td><TD bgcolor=#3333FF><TABLE WIDTH=100% height=70 BORDER=0 CELLSPACING=2 CELLPADDING=0><TR><td bgcolor=#eeeeee align=center>邮件正在发送, 请稍候...</td></tr></table></td><td width=30%></td></tr></table></div>
<div id="esave" style="position:absolute; top:200; left:20; z-index:10; visibility:hidden"><TABLE WIDTH=100% BORDER=0 CELLSPACING=0 CELLPADDING=0><TR><td width=30%></td><TD bgcolor=#3333FF><TABLE WIDTH=100% height=70 BORDER=0 CELLSPACING=2 CELLPADDING=0><TR><td bgcolor=#eeeeee align=center>邮件正在保存中, 请稍候...</td></tr></table></td><td width=30%></td></tr></table></div>

<table width="90%" border="1" bgcolor="#eeeeee" bordercolorlight="#999999" bordercolordark="#FFFFFF" align="center" cellspacing="0">
<tr bgcolor="#FFFFFF">
<td colspan="2" align="center">
<input type="button" value=" 增 加 附 件 " onclick="javascript:badd()">
</td>
</tr>
</table>

<table width="90%" border="1" bordercolorlight="#999999" bordercolordark="#FFFFFF" align="center" bgcolor="#eeeeee" cellspacing="0">
<tr>
<td colspan="2">
<input name="file0" type="file" size="70" class='textbox'>
</td>
</tr>
</table>
<p id="add1"></p>
<p id="add2"></p>
<p id="add3"></p>
<p id="add4"></p>
<p id="add5"></p>
<p id="add6"></p>
<p id="add7"></p>
<p id="add8"></p>
<p id="add9"></p>
<p id="add10"></p>
<p id="add11"></p>
<p id="add12"></p>
<p id="add13"></p>
<p id="add14"></p>
<p id="add15"></p>
<p id="add16"></p>
<p id="add17"></p>
<p id="add18"></p>
<p id="add19"></p>
<p> </p>
<p> </p>
</FORM>

</BODY>
</HTML>
 
这是ASP问题,方错地方了.
 
呵呵,反正有点关系吧。还是没有人回答呀。我知道是因为
FORM ENCTYPE="multipart/form-data"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~这个的原因,但是还是想不出比较好的解决方法
特别是关于附件上的管理问题
 
这个东西必须在服务器上安装WEBEASYMAIL后才能使用。
 
什么意思,如果是指组件的话,我可以自己写
 
你需要自己写个组件来接收提交的内容
 
下载一个jmail来安装,再看看它的例程,就什么都解决了,asp这种东东简单得要命。

网上的免费东东到处都有,实在不行,你可以去下一个论坛,找到它发email的代码研究也行呀。
 
用这个试一下
test=request.form("EasyMail_From")
 

Similar threads

A
回复
0
查看
732
Andreas Hausladen
A
I
回复
0
查看
745
import
I
I
回复
0
查看
800
import
I
I
回复
0
查看
762
import
I
I
回复
0
查看
588
import
I
后退
顶部