最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
howto: send a mail, exchange script read your mail
时间:2022-06-30 11:37:21 编辑:袖梨 来源:一聚教程网
Again, no error handle, no optimize, just demo test...
paste this to your exchange event script
========================================================
T RunAt=Server Language=VBScript>
Option Explicit
' Event Handlers
'---------------------------------------------------------------------
' DESCRIPTION: This event is fired when a new message is added to the folder
Public Sub Folder_OnMessageCreated
On Error Resume Next
Dim AMSession
Dim fldrOutbox
Dim msgTarget
Dim fldrTarget
Dim oStores
Dim Temp
Dim idTargetFolder
Dim idTargetMessage
Dim msgResponse
idTargetFolder = EventDetails.FolderID
idTargetMessage = EventDetails.MessageID
Set AMSession = EventDetails.Session
Set fldrOutbox = AMSession.Outbox
Set fldrTarget = AMSession.GetFolder( idTargetFolder, Null )
Set msgTarget = AMSession.GetMessage( idTargetMessage, Null )
' =========================================================================
Dim oConn
Dim oRs
Dim Index
dim strDBResult
dim dbcnstr
Set oConn = CreateObject("ADODB.Connection")
dbcnstr = "driver={SQL Server};server=sqlserver;database=demo;uid=sa;pwd="
oConn.Open dbcnstr
Set oRs = CreateObject("ADODB.Recordset")
paste this to your exchange event script
========================================================
Option Explicit
' Event Handlers
'---------------------------------------------------------------------
' DESCRIPTION: This event is fired when a new message is added to the folder
Public Sub Folder_OnMessageCreated
On Error Resume Next
Dim AMSession
Dim fldrOutbox
Dim msgTarget
Dim fldrTarget
Dim oStores
Dim Temp
Dim idTargetFolder
Dim idTargetMessage
Dim msgResponse
idTargetFolder = EventDetails.FolderID
idTargetMessage = EventDetails.MessageID
Set AMSession = EventDetails.Session
Set fldrOutbox = AMSession.Outbox
Set fldrTarget = AMSession.GetFolder( idTargetFolder, Null )
Set msgTarget = AMSession.GetMessage( idTargetMessage, Null )
' =========================================================================
Dim oConn
Dim oRs
Dim Index
dim strDBResult
dim dbcnstr
Set oConn = CreateObject("ADODB.Connection")
dbcnstr = "driver={SQL Server};server=sqlserver;database=demo;uid=sa;pwd="
oConn.Open dbcnstr
Set oRs = CreateObject("ADODB.Recordset")
相关文章
- 无限暖暖搭乘大鸟巴士怎么玩 公测第三天每日任务做法介绍 12-27
- 奇迹暖暖绚光护佑搭配攻略 奇迹暖暖绚光护佑过关攻略 12-27
- 绝区零月城柳意像影画怎么样 12-27
- 无限暖暖翩翩愿飞去怎么样 12-27
- 黑神话悟空1.0.12.16581版本更新公告 12-27
- 光遇12.27红石碎片在哪里 12-27