MAPI의 작동 방식을 이해하는 데 도움을 줄 수있는 사람은 누구입니까? MAPI를 사용하여 이메일을 보내는 간단한 vbscript가 있습니다. 그것은 완벽하게 잘 작동하지만, 어떻게 그 일을하는지 모르겠다 ... 백그라운드에서 무슨 일이 일어나고있는거야? 위 실제로 메일 메시지를 보내도록 Outlook의 설치 버전을 사용하고이 코드에 뭐 사전에이 스크립트 (Outlook을 사용하여 전자 메일 보내기)는 어떻게 작동합니까?
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 = "[email protected]"
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
감사합니다 ...
몇 가지 간단한 방법으로 COM을 설명 할 수 있습니까? :) – duper
위키피디아의 COM에 대한 자세한 내용은 다음과 같습니다. http://en.wikipedia.org/wiki/Component_Object_Model – dmarietta
이 스크립트는 어떻게 사용할 수 있습니까? – Mowgli