为什么我的机子老是收发同一邮件?

casneton casneton 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
我用如下代码发送邮件,可是在我的邮箱里老是收到很同一邮件,发送时间都是一样的

<!--#include file="../inc/conn.asp"-->

<%

dim email,username,password
email=request("email")
dim rs, sql
Set rs=Server.CreateObject("Adodb.RecordSet")
sql="select * from [Author_users] where email='"&email&"' and userName<>'' order

by ID desc"
rs.Open sql,conn,1,1
username=rs("username")
password=rs("password")

Dim cm
'创建对象
Set cm=Server.CreateObject("CDO.Message")
'设置发信人的邮箱
cm.From="dfhm@test.com"'"from@test.com"
'设置收信人的邮箱
cm.To=email
'设定邮件的主题
cm.Subject="Username and password"
'cm.TextBody="http://www.knowsky.com/rss/"
'上面是使用普通的文本格式发送邮件,只能是文字,不能支持html,所以这里不用

cm.HtmlBody="Your login information to access , Online Peer Review system for the

Canadi an Geotechnical Journal.<p>"&_

"username:"&username&"<br>"&_
"password:"&password&"</p><p>"&_

"Please note: the username and password are case sensitive.Please store this info

rmation in a safe place."&_
"If you wish to change your username and password or contact information please

s"&_
"elect '&change your details' from the main page after you have logged in."

'上面就是你构建的html正文,这样发出的邮件就比只有文字的好看多了。不要说你不会html

吧

'cm.AddAttachment Server.MapPath("test.zip")
'如果有需要发送附件的话就用上面的方法把文件附加进去。

cm.Send
'最后当然是执行发送了
Set cm=Nothing
'发送成功后即时释放对象
Response.Write("发送邮件成功。")
rs.close
set rs=nothing

%>

...全文
评论 1
收藏 已收藏
分享
返回顶部
casneton
ASP 28,401 成员 356,940 内容