求自动发送邮件的代码!

dingjin_dj 2005-04-01 03:54:43
现在很多网站都采用了邮寄密码的方式,并支持忘记密码后邮寄密码到邮箱的功能。
哪位大虾能提供相关代码,将高分送上!
...全文
111 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
lifeng800 2005-04-01
  • 打赏
  • 举报
回复
Set msg = Server.CreateObject("JMail.Message")
msg.silent = true
msg.Logging = true
msg.Charset = "gb2312"
msg.ContentType = "text/html"
msg.MailServerUserName = "lifeng" -----邮件用户名
msg.MailServerPassword = "web111" -------邮件密码
msg.From = "666@163.com"
msg.FromName = "订购信息"


msg.AddRecipient "aaa@163.com"

msg.Subject = "订购信息"
msg.Body = html

msg.Send ("....")--------填写邮件服务器
msg.clearRecipients()
mymyal123 2005-04-01
  • 打赏
  • 举报
回复
sub SendMail(strSubject,strContent,strEmail ,strFromer )
Set txtmail = Server.CreateObject("JMail.Message")
txtmail.Silent = true
txtmail.Logging = true
txtmail.Charset = "gb2312"
txtmail.MailServerUserName = "frankmick@sina.com" '输入smtp服务器验证登陆名 (邮局中任何一个用户的Email地址)
txtmail.MailServerPassWord = "xxxx" '输入smtp服务器验证密码 (用户Email帐号对应的密码)
txtmail.From = "frankmick@sina.com" '发件人Email txtmail.FromName = strFromer '发件人姓名
txtmail.AddRecipient strEmail '收件人Email
txtmail.Subject = strSubject '信件主题
txtmail.HTMLBody = strContent '正文
txtmail.Send ("smtp.sina.com") 'smtp服务器地址(企业邮局地址)
set txtmail = nothing
End Sub

加上如下语句,否则还有可能出现乱码的可能性:

txtmail.Charset = "gb2312"
txtmail.ContentTransferEncoding = "base64"
txtmail.Encoding = "base64"
txtmail.ISOEncodeHeaders = false

28,406

社区成员

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

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