Using the LuaCOM plugin, you can easily initiate an email message complete with attachments though MS Outlook's COM API.
Here is some sample code that will make an email message through Outlook. Note that I have only tested this on Outlook 2000 using v1.0.0.2 of the LuaCOM plugin.
You can do a whole lot more than this as well such as setting up appointments and enumerating mail and contact items. Consult the MS Outlook COM model documentation for more details.
Here is some sample code that will make an email message through Outlook. Note that I have only tested this on Outlook 2000 using v1.0.0.2 of the LuaCOM plugin.
Code:
olMailItem = 0; Outlook = luacom.CreateObject("Outlook.Application"); EmailMessage = Outlook:CreateItem(olMailItem); EmailMessage.To = "[email protected]"; EmailMessage.CC = "[email protected]"; EmailMessage.Subject = "This is a test!"; EmailMessage.Body = "I love to send email!\r\nHow about you?"; EmailMessage.Attachments:Add("C:\\File 1.txt"); -- Add other attachments... -- EmailMessage.Attachments:Add("C:\\File 2.txt"); EmailMessage:Display(); EmailMessage = nil; Outlook = nil;
Comment