请帮我看一下这个jmail发送程序

knad123 2009-09-09 06:02:48
这个发送程序是好的。可以使用,但是我想用本机 127.0.0.1来发

我本机的smtp用的iis自带的。测试可以发送了。

这个程序要验证 smftp服务器的用户名和密码,我想改成不需要验证用户名和密码的,因为本机IIS的smtp服务器是匿名的


请朋友帮我修改一下。。。万分感谢

<%
Server.ScriptTimeout=9999999
%>
<%
set conn = server.CreateObject("adodb.connection")
on error resume next
conn.Open "driver={microsoft access driver (*.mdb)}; dbq=" & server.MapPath("2u3@#langxin.mdb")

set rs1=Server.CreateObject("ADODB.Recordset")
sql="select * from config where id=1"
rs1.open sql,conn,1,1
smtp =rs1("pcsmtpserver")'发送邮件所使用的SMTP服务器
username =rs1("pcsmtpuser") '与SMTP服务器对应的邮箱用户名
userpassword =rs1("pcsmtppwd") '与SMTP服务器对应的邮箱密码
useremail =rs1("pcsmtpemail") 'SMTP服务器发信邮箱
hemail=rs1("pcsmtphuifu") '回复的邮箱
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
<table border="0" width="100%" id="table1" cellspacing="0" cellpadding="0" height="100%">
<tr>
<td align=center>
</td>
<%
set rs = Server.CreateObject("ADODB.Recordset")
sql="select email from mail"
rs.open sql,conn,1,1

totalcount=request("totalcount")
if isnull(totalcount) or totalcount="" then
totalcount=0
end if

dim email,nowpage
'***********************************分页
count=cint(session("sendnum"))

if not rs.eof then
rs.pagesize=count
pagecount=rs.pagecount
if request("pageid")="" then
nowpage=1
else
nowpage=int(request("pageid"))
end if
if nowpage>rs.pagecount then
response.write "发送完毕,服务器:"&smtp&" 总共发送邮件<b><font color=red>"&totalcount&"</font></b>"
response.end
end if
if nowpage>=rs.pagecount then
nowpage=rs.pagecount
elseif nowpage<=1 then
nowpage=1
end if
rs.absolutepage=nowpage
else
pagecount=1
nowpage=1
end if
a=1
Dim JMail,msg
Set JMail = Server.CreateObject("JMail.Message")
do while not rs.eof and a<=count
JMail.Charset = "gb2312"
JMail.ContentType = "text/html"
JMail.From = useremail
JMail.FromName = session("sendername")
JMail.Subject = session("title")
jmail.ReplyTo = hemail
JMail.MailServerUserName = username
JMail.MailServerPassword = userpassword
JMail.AddHeader "Originating-IP", Request.ServerVariables("REMOTE_ADDR")
JMail.ClearRecipients()
for i=1 to 10
if not rs.eof and a<=count then
email=rs(0)
JMail.AddRecipient(email)
a=a+1
rs.movenext
end if
next
JMail.Body = session("content")
msg=JMail.Send(smtp)
loop
rs.close
set rs=nothing
conn.close
set conn=nothing
' 关闭并清除对象
JMail.Close()
Set JMail = Nothing

totalcount=cint(totalcount)+cint(a)-1
%>
正在发送中。。。已发送邮件<b><font color=red><%=totalcount%></font></b>封
</tr>
</table>
</table>
<meta http-equiv="refresh" content="<%=session("sendtime")%>;URL=email_send.asp?pageid=<%=cint(nowpage)+1%>&totalcount=<%=totalcount%>">
</body>
</html>
...全文
53 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
knad123 2009-09-10
  • 打赏
  • 举报
回复
我前两天也是这样去掉用户名和密码。。

应该是这样设的

肯定是网易邮箱屏蔽了127.0.0.1本地smtp服务器
knad123 2009-09-10
  • 打赏
  • 举报
回复
去掉 JMail.MailServerUserName = username
JMail.MailServerPassword = userpassword
不行

这样好像不是匿名 不知道jmail用匿名怎么设置
hookee 2009-09-09
  • 打赏
  • 举报
回复
去掉 JMail.MailServerUserName = username
JMail.MailServerPassword = userpassword
knad123 2009-09-09
  • 打赏
  • 举报
回复
3楼的朋友感谢。请问都改了一些什么?能不能说明一下 。。

gxq323 2009-09-09
  • 打赏
  • 举报
回复
学习了
hookee 2009-09-09
  • 打赏
  • 举报
回复

<%
Server.ScriptTimeout=9999999
%>
<%
set conn = server.CreateObject("adodb.connection")
on error resume next
conn.Open "driver={microsoft access driver (*.mdb)}; dbq=" & server.MapPath("2u3@#langxin.mdb")

set rs1=Server.CreateObject("ADODB.Recordset")
sql="select * from config where id=1"
rs1.open sql,conn,1,1
smtp =rs1("pcsmtpserver")'发送邮件所使用的SMTP服务器
username =rs1("pcsmtpuser") '与SMTP服务器对应的邮箱用户名
userpassword =rs1("pcsmtppwd") '与SMTP服务器对应的邮箱密码
useremail =rs1("pcsmtpemail") 'SMTP服务器发信邮箱
hemail=rs1("pcsmtphuifu") '回复的邮箱
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
<table border="0" width="100%" id="table1" cellspacing="0" cellpadding="0" height="100%">
<tr>
<td align=center>
</td>
<%
set rs = Server.CreateObject("ADODB.Recordset")
sql="select email from mail"
rs.open sql,conn,1,1

totalcount=request("totalcount")
if isnull(totalcount) or totalcount="" then
totalcount=0
end if

dim email,nowpage
'***********************************分页
count=cint(session("sendnum"))

if not rs.eof then
rs.pagesize=count
pagecount=rs.pagecount
if request("pageid")="" then
nowpage=1
else
nowpage=int(request("pageid"))
end if
if nowpage>rs.pagecount then
response.write "发送完毕,服务器:"&smtp&" 总共发送邮件 <b> <font color=red>"&totalcount&" </font> </b>"
response.end
end if
if nowpage>=rs.pagecount then
nowpage=rs.pagecount
elseif nowpage <=1 then
nowpage=1
end if
rs.absolutepage=nowpage
else
pagecount=1
nowpage=1
end if
a=1
Dim JMail,msg
Set JMail = Server.CreateObject("JMail.Message")
do while not rs.eof and a <=count
JMail.Charset = "gb2312"
JMail.ContentType = "text/html"
JMail.From = useremail
JMail.FromName = session("sendername")
JMail.Subject = session("title")
jmail.ReplyTo = hemail
JMail.AddHeader "Originating-IP", Request.ServerVariables("REMOTE_ADDR")
JMail.ClearRecipients()
for i=1 to 10
if not rs.eof and a <=count then
email=rs(0)
JMail.AddRecipient(email)
a=a+1
rs.movenext
end if
next
JMail.Body = session("content")
msg=JMail.Send(smtp)
loop
rs.close
set rs=nothing
conn.close
set conn=nothing
' 关闭并清除对象
JMail.Close()
Set JMail = Nothing

totalcount=cint(totalcount)+cint(a)-1
%>
正在发送中。。。已发送邮件 <b> <font color=red> <%=totalcount%> </font> </b>封
</tr>
</table>
</table>
<meta http-equiv="refresh" content=" <%=session("sendtime")%>;URL=email_send.asp?pageid= <%=cint(nowpage)+1%>&totalcount= <%=totalcount%>">
</body>
</html>
knad123 2009-09-09
  • 打赏
  • 举报
回复
请朋友们帮帮忙

28,406

社区成员

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

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