求自动发送邮件的代码!
现在很多网站都采用了邮寄密码的方式,并支持忘记密码后邮寄密码到邮箱的功能。
哪位大虾能提供相关代码,将高分送上!
问题点数:50、回复次数:2Top
1 楼mymyal123(风之森)回复于 2005-04-01 16:27:08 得分 40
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
Top
2 楼lifeng800(j2ee学习中)回复于 2005-04-01 16:34:24 得分 10
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()Top




