谁能帮我理解 MAPI 的工作原理?我有这个使用 MAPI 发送电子邮件的简单 vbscript。它工作得非常好,但是,我不知道它是如何做到的......后台发生了什么?
Const ForReading = 1
Set args = WScript.Arguments
sqlFile = args.Item(0)
logFile = args.Item(1)
Dim ToAddress
Dim FromAddress
Dim MessageSubject
Dim MyTime
Dim MessageBody
Dim MessageAttachment
Dim ol, ns, newMail
MyTime = Now
ToAddress = "my@email.com"
MessageSubject = "Subject goes here"
MessageBody = "Body message goes here."
MessageAttachment = ""&logFile&""
Set ol = WScript.CreateObject("Outlook.Application")
Set ns = ol.getNamespace("MAPI")
Set newMail = ol.CreateItem(olMailItem)
newMail.Subject = MessageSubject
newMail.Body = MessageBody & vbCrLf & MyTime
newMail.RecipIents.Add(ToAddress)
newMail.Attachments.Add(MessageAttachment)
newMail.Send
提前致谢...