日期:2014-05-16  浏览次数:21502 次

asp+iis,怎么实现邮件发送功能
求实现邮件发送功能,大概看了一下,有个JMail组件,求具体实现方法,或者其它的实现方法

------解决方案--------------------
regsvr32 jmail.dll 之后 稍微更改下面代码 就可以用了



VBScript code

<%
'-----------------发送电子邮件函数
'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

siteEmail="******@qq.com"
smtp ="smtp.qq.com"
emailUserName = "******@qq.com"
emailUserPWD = "******"
inceptEmail ="******@qq.com"
sendName = "******"
sendTitle = "******"
sendContent = "<html><head><meta content=""zh-cn"" http-equiv=""Content-Language""><meta http-equiv=""Content-Type"" content=""text/html; charset=gb2312""><style type=text/css>A:link { FONT-SIZE: 9pt; TEXT-DECORATION: none; color: #000000}A:visited {FONT-SIZE: 9pt; TEXT-DECORATION: none; color: #666666}A:hover {COLOR: #ff6600; FONT-SIZE: 9pt; TEXT-DECORATION: underline}BODY {FONT-SIZE: 9pt} --></style></head><body><font color=red>邮件正文</font><br><font color=green>邮件正文</font><br><b>邮件正文</b></body></html>"

call EmailSend(siteEmail,smtp,emailUserName,emailUserPWD,inceptEmail,sendName,sendTitle,sendContent)

%>

------解决方案--------------------
jmail
------解决方案--------------------
很多人都用 winwebmail ,你也试试吧。设置也很简单。