<%
Group_ID=Request("Group_ID")
on error resume next
'
Set Rs=Conn.Execute(Access)
While Not Rs.Eof
Const cdoSendUsingMethod="http://schemas.microsoft.com/cdo/configuration/sendusing"
Const cdoSendUsingPort=2
Const cdoSMTPServer="http://schemas.microsoft.com/cdo/configuration/smtpserver"
Const cdoSMTPServerPort="http://schemas.microsoft.com/cdo/configuration/smtpserverport"
Dim objConfig ' As CDO.Configuration
Dim objMessage ' As CDO.Message
Dim Fields ' As ADODB.Fields
Set objConfig = Server.CreateObject("CDO.Configuration")
Set Fields = objConfig.Fields
With Fields
.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item(cdoSMTPServer) = "***"
.Item(cdoSMTPServerPort) = 25
.Update
End With
Set objMessage = Server.CreateObject("CDO.Message")
Set objMessage.Configuration = objConfig
MailTo=Rs("M.Mail")
MailFrom=Rs("Account_Name") & "讯息通知<" & RS("M1.Mail") &">"
MailSubject="讯息通知: " & RS("Title")
body=Replace(RS("Description"),vbCrLf,"<BR>")
IF RS("Att_Files")<>"" OR RS("Att_Files2")<>"" OR RS("Att_Files3")<>"" OR RS("Att_Files4")<>"" OR RS("Att_Files5")<>"" Then
body=body & "<BR>※您的讯息通知有包含附件,详细内容请参阅EIP讯息通知。"
End IF
response.write MailTo & "<br>"
response.write MailFrom & "<br>"
response.write MailSubject & "<br>"
response.write body & "<br>"
'response.end
With objMessage
.To = MailTo
.From = MailFrom
.Subject = MailSubject
.HtmlBody =body
.Send
End With
Rs.MoveNext
Wend
Set Fields = Nothing
Set objMessage = Nothing
Set objConfig = Nothing
Response.Redirect "Message_To_You_List.asp"
%>
【Vegas原创】CDO发送邮件
原创李济宏Amadeus 博主文章分类:ASP ©著作权
©著作权归作者所有:来自51CTO博客作者李济宏Amadeus的原创作品,请联系作者获取转载授权,否则将追究法律责任
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
【Vegas原创】asp.net页面作为邮件正文发送
此类页面的发送要
html 发送邮件 asp.net -
【Vegas原创】Oracle使用自带的UTL_MAIL发送邮件
Steps to enable Mail
sql oracle html -
asp中用CDO发送简单电子邮件
用CDO发送简单电子邮件的例子。很简单。带入如mas.mic
asp 服务器 microsoft Server 用户名 -
【Vegas原创】a href=
使用javascript的时候,通常我们
javascript 跳转页面