请问如何将用户注册的表单提交到指定邮箱呢?请大家帮忙我!!

andy888666 2004-11-26 06:32:26
请问如何将用户注册的表单提交到指定邮箱呢?请大家帮忙我!!
...全文
71 点赞 收藏 5
写回复
5 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
hqppp 2004-11-26
jmail是免费组件吗?
我用Ms smtp怎么根本就发送不成功啊
回复
andy888666 2004-11-26
我刚用ASP不久,用什么组件?在哪里能找到?希望能说清楚点。谢谢阿!
回复
bluemoon0001 2004-11-26
如果用jmail 参考:

下面是我的邮件收发系统中的,发送贺卡的代码,希望对你有所帮助
<%@LANGUAGE="VBScript" CODEPAGE="936"%>
<%
'Option Explicit
'功能:发送邮件
'设计人:
'设计时间:2004.03.14
'修改时间:
'修改人
'Response.Buffer = True
'Response.ExpiresAbsolute = Now() - 1
'Response.Expires = 0
'Response.CacheControl = "no-cache"
%>
<!--#include file="../../Connections/CONN.asp" -->
<!--#include file="../../INC/Is_chaoshi3.asp" -->
<%
Server.ScriptTimeout = 3600
http=Request.ServerVariables("HTTP_REFERER")
If instr(http,"seecard.asp")=0 Then
response.write "你提交的路径有误,禁止从站点外部提交数据!"
response.end
end if
remail=trim(request("remail"))
'topic=trim(request("topic"))
types=trim(request("types"))
mname=trim(request("mname"))
fname=trim(request("fname"))
saveyn=request("saveyn")
content=replace(request("content"),"'","´")
function GetExtendName(FileName)
dim ExtName
ExtName = LCase(FileName)
ExtName = mid(ExtName,instr(ExtName,".")+1)
GetExtendName = ExtName
end function
set conn=Server.CreateObject("adodb.Connection")
conn.open MM_add_STRING
set rs=conn.execute("select * from lsl_pop where User_id="&session("oid"))
if rs.eof then
msgstr="<br><br><br>你的账号还没有设置,请先设置账号!!<br><br>[<a href=../email/setaccount.asp>设置账号</a>]"

else
formname=rs("Mail_name")
frommail=rs("mailaddr")

if remail="" or InStr(remail,".")=0 or InStr(remail,"@")=0 then
msgstr="<br><br><br><table border='0' width='350' cellspacing='0' cellpadding='0'><tr><td width='100%' bgcolor='#6666FF'><font color='#FFFF00' >发送失败</font></td></tr><tr><td width='100%' bgcolor='#6666FF'><table border='0' width='100%' cellspacing='1' cellpadding='0'><tr><td width='100%' bgcolor='#FFFFFF'><table border='0' width='100%' cellspacing='0' cellpadding='0'><tr><td width='100%'><p align='center'><font color='red' size='3'><br>邮件发送失败</font></td></tr><tr><td width='100%'><hr size='1' width='75%'></td></tr><tr><td width='100%'><p align='center'>没有填写收件人地址,或收件人地址不正确!</td></tr><tr><td width='100%'><hr size='1' width='75%'></td></tr><tr><td width='100%' align='center'><a href='javascript:history.go(-1);'>返回</a></td></tr><tr><td width='100%'></td></tr></table></td></tr></table></td></tr></table>"
else
if saveyn<>"" then
conn.execute("insert into greet(content,user_id) values('"&replace(content,"'","´")&"',"&session("oid")&")")
end if
succeed=false
Set jmail1 = Server.CreateObject("JMail.Message")

'jmail1.AddRecipient "lishenlong0001@yahoo.com.cn", "Mr.Example"
if InStr(remail,",")=0 then
jmail1.AddRecipient remail
else
remaila=split(remail,",")
if right(remail,1)="," then
tonum=UBound(remaila)-1
else
tonum=UBound(remaila)
end if
for i=0 to tonum
jmail1.AddRecipient remaila(i)
next
end if
jmail1.From = frommail
jmail1.FromName = formname

jmail1.Subject = "贺卡《"&mname&"》"
'jmail1.Body = "A nice picture if you can read HTML-mail."

' The return value of AddAttachment is used as a
' reference to the image in the HTMLBody.

'contentId=jmail1.AddAttachment("C:\Inetpub\wwwroot\card\images\0c.jpg")


' As only HTML formatted emails can contain inline images
' we use HTMLBody and appendHTML
fname=replace(http,"seecard.asp","images/"&fname)
content=replace(content,vbCrLf,"<br>")
content=replace(content," "," ")
if GetExtendName(request("fname"))="gif" or GetExtendName(request("fname"))="GIF" or GetExtendName(request("fname"))="Gif" or GetExtendName(request("fname"))="jpg" or GetExtendName(request("fname"))="JPG" or GetExtendName(request("fname"))="Jpg" then
jmail1.HTMLBody = "<img width=459 height=306 src="&fname&"></img><br>"&content
else
jmail1.HTMLBody = "<object classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0 width=459 height=306><param name=movie value="&fname&"><param name=quality value=high><embed src="&fname&" quality=high pluginspage=http://www.macromedia.com/go/getflashplayer type=application/x-shockwave-flash width=459 height=306></embed></object><br>"&content
end if
'jmail1.appendHTML
'jmail1.appendHTML

' But as not all mailreaders are capable of showing HTML emails
' we will also add a standard text body
'jmail1.Body = "Too bad you can't read HTML-mail."
'jmail1.appendText " There would have been a nice picture for you"
jmail1.Charset = "gb2312"
jmail1.ContentTransferEncoding = "base64"
jmail1.Encoding = "base64"
jmail1.ISOEncodeHeaders = false
succeed=jmail1.Send("")
jmail1.close
set jmail1=nothing
if succeed=true then
msgstr="<br><br><br><table border='0' width='350' cellspacing='0' cellpadding='0'><tr><td width='100%' bgcolor='#6666FF'><font color='#FFFF00' >恭喜您, 贺卡发送成功!</font></td></tr><tr><td width='100%' bgcolor='#6666FF'><table border='0' width='100%' cellspacing='1' cellpadding='0'><tr><td width='100%' bgcolor='#FFFFFF'><table border='0' width='100%' cellspacing='0' cellpadding='0'><tr><td width='100%'><p align='center'><font color='#329900' size='3'><br>贺卡发送成功!</font></td></tr><tr><td width='100%'><hr size='1' width='75%'></td></tr><tr><td width='100%'><p align='center'>恭喜您, 贺卡发送成功!</td></tr><tr><td width='100%'><hr size='1' width='75%'></td></tr><tr><td width='100%' align='center'><a href='javascript:history.go(-2);'>返回</a></td></tr><tr><td width='100%'></td></tr></table></td></tr></table></td></tr></table>"
else
msgstr="<br><br><br><table border='0' width='350' cellspacing='0' cellpadding='0'><tr><td width='100%' bgcolor='#6666FF'><font color='#FFFF00' >贺卡发送失败</font></td></tr><tr><td width='100%' bgcolor='#6666FF'><table border='0' width='100%' cellspacing='1' cellpadding='0'><tr><td width='100%' bgcolor='#FFFFFF'><table border='0' width='100%' cellspacing='0' cellpadding='0'><tr><td width='100%'><p align='center'><font color='#329900' size='3'><br>贺卡发送失败</font></td></tr><tr><td width='100%'><hr size='1' width='75%'></td></tr><tr><td width='100%'><p align='center'>发送失败, 服务器忙,请稍后再发!</td></tr><tr><td width='100%'><hr size='1' width='75%'></td></tr><tr><td width='100%' align='center'><a href='javascript:history.go(-1);'>返回</a></td></tr><tr><td width='100%'></td></tr></table></td></tr></table></td></tr></table>"
end if
'response.write jmail1.From
end if

end if
%>
<html>

<head>
<title>发送贺卡</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../../css/CSS.CSS" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#CCCCCC">
<bbody oncontextmenu="return false" bgcolor="#CCCCCC">
<table width="549" height="24" border="0" cellpadding="0" cellspacing="0" background="../images/002.png">
<tr>
<td><font color="#FFFFFF"><strong>    发送贺卡</strong></font></td>
</tr>
</table>
<table width="549" height="400" border="1" cellpadding="0" cellspacing="0" bordercolorlight="#008080" bordercolordark="#FFFFFF">
<tr>
<td valign="top" bgcolor="#FFFFFF">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td> 


<div align="center"><%
response.write msgstr
%></div>

</td>
</tr>
</table>

</td>
</tr>
</table>
</body>
</html>
回复
bluemoon0001 2004-11-26
如果用outlook 参考:

<script language=javascript>
function sendto()
{
var subject1="产品订购";
var body1="您的姓名:"+document.myform.username.value; //回车换行的忘了怎么写的,这里去了,测试通过
body1=body1+"公司名称:"+document.myform.Co_name.value;
....
this.location="mailto:hzck@vip.163.com?subject="+subject1+"&body="+body1;
return false;

}
<script>

<FORM action="mailto:hzck@vip.163.com" method=post onsubmit="sendto()" name="myform">
回复
你用组件就是了
回复
相关推荐
发帖
ASP
创建于2007-09-28

2.8w+

社区成员

ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
申请成为版主
帖子事件
创建了帖子
2004-11-26 06:32
社区公告
暂无公告