(在线等待)关于ASP自动发送邮件的问题!

ms6309a 2009-01-13 08:37:21
下面的代码是我注册后发送邮件的代码,测试时说是成功发送了,也没有什么错误信息,可是信箱里就是收不到信件,不知道这是为什么,无奈中。。。
请各位高帮在下看看代码中是否存在问题,jmail已经成功注册了!


<!--#include file=conn1.asp-->
<!--#include file=err.asp-->
<!--#include file=ipt.asp-->
<!--#include file=md5.asp-->
<!--#include file=mail.asp-->
<!--#include file="config.asp"-->
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><%=title%>-会员注册成功</title>
<link href="inc_style.css" rel="stylesheet" type="text/css">
</head>
<%dim action
action=request("action")
if action<>"yes" then
response.redirect "regterm.asp"
response.end
end if
%>

<SCRIPT language=javascript>
function CheckForm()
{
if(document.thisForm.username.value.length<1)
{
alert("用户名不能为空!");
return false;
}
if(document.thisForm.password.value.length<1)
{
alert("密码不能为空!");
return false;
}
}
</SCRIPT>

<%
dim username,password,hangye,comname,jianjie,name,Sex,idcard,dianhua,chuanzhen,qq,dizhi,email,rs3,diqu
dim comlogo,banner,xxpic
dim rs,sql,rs2,sql2
username=trim(request("comusername"))
password=request("compassword")
email=request("comemail")
hangye=trim(request("hangye"))
diqu=trim(request("diqu"))

comname=trim(request("com"))
jianjie=request("comabout")
name=trim(request("comname"))
idcard=trim(request("comidcard"))
Sex=trim(request("Sex"))
dianhua=trim(request("comdianhua"))
chuanzhen=trim(request("comfax"))
qq=trim(request("qq"))
dizhi=trim(request("comdizhi"))
comlogo=trim(request("logo"))
banner=trim(request("banner"))
xxpic=trim(request("xxpic"))

chkcnmai(username)
chkcnmai(name)
if nothaveChinese(username)=false then
call errcnmai(3)
response.end
end if
if IsValidemail(email)=false then
call errcnmai(1)
response.end
end if
if not isnumeric(idcard) or len(idcard)<15 or len(idcard)>18 then
call errcnmai(6)
response.end
end if
set rs=server.createobject("adodb.recordset")
sql="select * from [user] where username='"&username&"'"
rs.open sql,conn,1,3
set rs2=server.createobject("adodb.recordset")
sql2="select * from [shangjia] where comname='"&comname&"'"
rs2.open sql2,conn,1,3
if (rs.eof or rs.bof) AND (rs2.eof or rs2.bof) then
rs.addnew
rs("username")=username
rs("password")=md5(password)
rs("name")=name
rs("email")=email
rs("idcard")=idcard
rs("Sex")=Sex
rs("diqu")=cint(diqu)

rs("dianhua")=dianhua
rs("qq")=qq
rs("dizhi")=dizhi
rs("zcdata")=now()
rs("a")=z_a
rs("b")=z_b
rs("c")=z_c
rs("d")=z_d
rs("jf")=jf_1
rs("hb")=z_hb
rs("diqu")=diqu


rs2.addnew
rs2("comname")=comname
rs2("hangye") =hangye
rs2("diqu")=cint(diqu)

rs2("intro")=jianjie
rs2("admin")=username
rs2("logo")=comlogo
rs2("banner")=banner
rs2("xxpic")=xxpic
rs2("chuanzhen")=chuanzhen
rs2.update
sql2="select id from [shangjia] where comname='"&comname&"'"

set rs3=server.createobject("adodb.recordset")
sql2="select id from [shangjia] where comname='"&comname&"'"
rs3.open sql2,conn,1,3
rs("shangjiaid")=rs3("id")
rs.update
%>
<body>
<!--#include file=top.asp-->
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="768" height="245" align="center">
<tr>
<td>
<table width="489" border="0" cellspacing="0" cellpadding="0" style="border-collapse: collapse" bordercolor="#111111" align="center">
<tr>
<td width="16"><img src="images/obj_waku3_01.gif"></td>
<td width="456"><img src="images/ba_home.gif"></td>
<td width="17"><img src="images/obj_waku3_02.gif"></td>
</tr>
<tr>
<td width="16" background="images/obj_waku3_03.gif"> </td>
<td width="456" bgcolor="#EEEEEE">
<table width="454" border="0" cellspacing="0" cellpadding="0" height="120">
<tr>
<td height="19" bgcolor="#EEEEEE" width="454">
<p align="center" style="line-height: 200%; margin-top: 0; margin-bottom: 0">
<font size="3">恭喜<%=name%>(商家用户)!<b><font color="#FF0000">注册成功了!</font></b></font></td>
</tr>
<tr>
<td height="19" bgcolor="#EEEEEE" width="454">
<li>
<p align="center"><font size="3"> </font><font size="2">我们同时将密码发送到了|<b><font color=""#ff0000""><%=email%></font></b>|,请保管好您的密码</font></p>
<table class="font_10_e_black" cellspacing="0" cellpadding="3" width="98%" align="center" border="0">
<form id="f1" name="thisForm" action="Loginchk.asp" method="POST">
<tr>
<td width="50%" align="right">登陆帐号:<input class="form_e_10_black" id="username" maxlength="20" size="16" name="username" value="<%=username%>">
</td>
<td width="50%" align="center"> </td>
</tr>
<tr>
<td align="right">登陆密码:<input class="form_e_10_black" id="password" maxlength="32" size="16" value="<%=password%>" name="password" type="password">
</td>
<td align="center"> </td>
</tr>
<%if yzm="1" then%>
<tr>
<td align="center" width="67%">
<p align="right">验 证 码:<input class=wenbenkuang name=verifycode type=text value="<%If GetCode=9999 Then Response.Write "9999" end if%>" maxLength=4 size=16></td>
<td align="center">
<p align="left">
<img src=GetCode.asp width="58" height="19"></td>
</tr>
<%end if%>
<tr>
<td align="center" colspan="2">
<input onClick="javascript:return CheckForm();" type="image" src="images/mail_login_r5_c2.gif" border="0" name="I3">
</td>
</tr>
</form>
</table></td>
</tr>
</table></td>
<td width="17" background="images/obj_waku3_04.gif"> </td>
</tr>
<tr>
<td width="16"><img src="images/obj_waku3_05.gif"></td>
<td width="456"><img src="images/obj_waku3_06.gif"></td>
<td width="17"><img src="images/obj_waku3_07.gif"></td>
</tr>
<tr>
<td width="489" colspan="3">您所注册的商户需要我们在24小时内审核通过!但在审核通过之前,您可以以个人会员身份登录网站。<br>
<font color="#FF0000">不被通过的可能:<br>★您的基本资料不完整或不吻合<br>★店铺物品/信息数量小于等于5件/条<br>★您的信息资料有重大欺骗性质</font></td>
</tr>
</table>
</td>
</tr>
</table>
<!--#include file=end.htm-->
<%
call mail()
else

if trim(rs("email"))=email then
call errcnmai(23)
response.end
end if
if trim(rs("username"))=username then
response.write "67868"
call errcnmai(22)
response.end
end if
if trim(rs2("comname"))=comname then
call errcnmai(31)
response.end
end if
call errcnmai(24)
response.end
end if
set rs=nothing
set rs2=nothing
set rs3=nothing

sub mail()
dim mailbody,Jmail
mailbody="欢迎您,来自"&comname&"的"&username&"!<br>恭喜您成为<a target=_blank href="&web&">"&title&"</a>的商家会员!<br>您的登陆帐号:"&username&"<br>您的登陆密码:"&password&"<br><br>登陆地址为:<a target=_blank href="&web&">"&web&"</a><br>["&title&"]<br>"&tel&""
Set Jmail=server.createobject("Jmail.Message")
Jmail.Charset ="gb2312"
Jmail.Silent =true
JMail.ContentType = "text/html"
Jmail.Priority = 3
Jmail.MailServerUserName = mailname
Jmail.MailServerPassword = mailpass
Jmail.From = mailform
Jmail.FromName =""&title&"管理员"
Jmail.Subject ="恭喜你注册成功,请查收登陆帐号!"
Jmail.AddRecipient ""&email&""
Jmail.Body = mailbody
Jmail.Send(mailsmtp)
Set Jmail=nothing
end sub
%>
...全文
447 31 打赏 收藏 转发到动态 举报
写回复
用AI写文章
31 条回复
切换为时间正序
请发表友善的回复…
发表回复
sy_binbin 2009-01-20
  • 打赏
  • 举报
回复
[Quote=引用 18 楼 ms6309a 的回复:]
十分感谢“sy_binbin”,但还是没解决问题!
端口也开了,SMTP也支持,但就是收不到邮件,我真是服了!
我的QQ:69632928,有哪位高手能帮我,我将程序传过去,帮我看一下,谢谢大家了!
[/Quote]

你用的SMTP是什么??

看看是不是防火墙给端口给屏蔽了
ms6309a 2009-01-20
  • 打赏
  • 举报
回复
自己再顶一下。
ms6309a 2009-01-20
  • 打赏
  • 举报
回复
大虾们,帮帮我吧!
sy_binbin 2009-01-20
  • 打赏
  • 举报
回复
[Quote=引用 29 楼 ms6309a 的回复:]
我的当然支持SMTP了,另一个程序我都测试通过了。。。只是这个不知道毛病出在哪里,所以才上来SOS的!
不过这里回答的人太不了,不过还是要感谢“sy_binbin”!
希望能有人帮我解决这个问题,在下不胜感激!!!!
[/Quote]

很简单,把你通过的那段代码拷过来用不就可以了吗!!

  • 打赏
  • 举报
回复
测试时说是成功发送了,也没有什么错误信息,可是信箱里就是收不到信件,不知道这是为什么,无奈中。。。


你用的什么邮箱发送???????并不是说你服务器支持不支持STMP的问题
而是你所用的邮箱服务器支持不支持,还有是不是进了过滤器了?所谓无法收到
ms6309a 2009-01-20
  • 打赏
  • 举报
回复
我的当然支持SMTP了,另一个程序我都测试通过了。。。只是这个不知道毛病出在哪里,所以才上来SOS的!
不过这里回答的人太不了,不过还是要感谢“sy_binbin”!
希望能有人帮我解决这个问题,在下不胜感激!!!!
sy_binbin 2009-01-20
  • 打赏
  • 举报
回复
[Quote=引用 27 楼 ms6309a 的回复:]
csdn里没有人能解决这个问题吗?
[/Quote]

我24楼已经说很清楚了
要是不支持SMTP的话谁都解决不了!
ms6309a 2009-01-20
  • 打赏
  • 举报
回复
csdn里没有人能解决这个问题吗?
ms6309a 2009-01-20
  • 打赏
  • 举报
回复
我用了你博客里的代码,还是不行。。。
  • 打赏
  • 举报
回复
为什么不看我博客里的那发送代码?

解释的非常清楚
sy_binbin 2009-01-20
  • 打赏
  • 举报
回复
2007年之前申请的163老用户支持SMTP
之后的就不支持了
  • 打赏
  • 举报
回复
为什么不看我博客里的那发送代码?

解释的非常清楚
ms6309a 2009-01-20
  • 打赏
  • 举报
回复
我的QQ:69632928,请老兄加我,教我弄弄!
我的SMTP:smtp.163.com
kentway 2009-01-19
  • 打赏
  • 举报
回复
SMTP设置并通过验证了吗
ms6309a 2009-01-19
  • 打赏
  • 举报
回复
自己再顶!
ms6309a 2009-01-19
  • 打赏
  • 举报
回复
110端口是开着的,肯定是这段代码有问题,请高手们帮我看看!
parss 2009-01-19
  • 打赏
  • 举报
回复
你看看有没有打开110号端口(默认发邮件为110,收邮件为21)

还有防火墙,如果不想设置的话就直接关了吧
ms6309a 2009-01-19
  • 打赏
  • 举报
回复
大家帮帮我啊,我这都要上火死了!
ms6309a 2009-01-19
  • 打赏
  • 举报
回复
十分感谢“sy_binbin”,但还是没解决问题!
端口也开了,SMTP也支持,但就是收不到邮件,我真是服了!
我的QQ:69632928,有哪位高手能帮我,我将程序传过去,帮我看一下,谢谢大家了!
sy_binbin 2009-01-19
  • 打赏
  • 举报
回复

''发送电子邮件函数
'siteEmail 发送方邮箱
'smtp 邮箱主机地址
'emailUserName 邮箱用户名
'emailUserPWD 邮箱密码
'inceptEmail 接受邮件的邮箱地址
'sendName 发送人的名称
'sendTitle 邮件标题
'sendContent 邮件正文
sub EmailSend(siteEmail,smtp,emailUserName,emailUserPWD,inceptEmail,sendName,sendTitle,sendContent)
dim jmail
set jmail = CreateObject ("jmail.message") ''创建对象
jmail.Silent = true ''一般不用改
jmail.Charset = "gb2312" ''信件的语言编码
jmail.ContentType = "text/html" ''信件的格式html或纯文本
jmail.From = siteEmail ''发信人邮箱
jmail.FromName = sendName ''发信人姓名
jmail.Subject = sendTitle ''信件主题
jmail.AddRecipient inceptEmail ''收信人地址
jmail.Body = sendContent ''信件正文
jmail.MailServerUserName = emailUserName ''服务器登陆用户名(您的邮件地址)
jmail.MailServerPassWord = emailUserPWD ''服务器登陆密码(您的邮件密码)
jmail.Send(smtp) ''服务器地址
jmail.Close
set jmail = nothing
end sub


给你发一个我经常用的一个邮件过程

另外LZ还要注意了,你发信箱如果不支持SMTP的话你还是收不到信的!
加载更多回复(11)

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧