1.表单代码:
<form name="form1" method="post" action="save.asp" >
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="24%"><div align="right">姓名:</div></td>
<td width="76%"><input name="name" type="text" id="name"></td>
</tr>
<tr>
<td><div align="right">密码:</div></td>
<td><input name="pwd" type="text" id="pwd"></td>
</tr>
<tr>
<td> </td>
<td> <input type="submit" name="Submit" value="提交"> <input type="reset" name="Submit" value="重填"></td>
</tr>
</table>
</form>
2、程序代码:save.asp
<%
mess = mess &"姓名:"&name & vbcrlf
mess = mess &"密码:"&pwd& vbcrlf
set msg=server.createobject("Jmail.Message"
msg.logging=true
msg.Charset = "gb2312"
msg.from="web163@163web.com"
msg.fromname="webemail"
msg.AddRecipient "qmds@qmds.net"
msg.subject=title
msg.body=mess
msg.MailServerUserName ="web163@163web.com"
msg.MailServerPassword ="123456"
err=msg.send("mail.163web.com"
if err then
Response.Write ("<script>alert('您的信息已经成功发送到我公司,我们会尽快处理您的信息');location.href='index.htm';</script>"
response.end
else
response.write "邮件发送出错"
end if
%>