Interfacing with a mail client on Windows

By default. MoneyWorks uses SimpleMAPI to create a new email message in the system mail client (assuming the default system mail client supports SimpleMAPI).

The drawback with SimpleMAPI is that it is modal (you must send or discard each message before you can continue), and there is no signature support.

From v7.3.7, the WIndows version of MoneyWorks supports an external script for mail client interfacing. Currently we don't supply a script in the install, but we will do so in the future. If you would like to try this functionality for improved integration with MS Outlook, here's how:

MoneyWorks will look for a script named mail_client_helper.vbs in the Standard Plugins Scripts folder. If this script is found, it will be run with the following parameters: mail_client_helper.vbs "attachmentpath" "recipients" "subject" "message"

The following script will create a new email retaining your default signature. It does this by grabbing the content of the new empty email (which contains the signature) then re-adding that content after attaching the enclosure (which obliterates the signature as a side effect).

' Usage mail_client_helper "attachmentpath"  "recip1" "subject" "message"
Set outlook = createobject("Outlook.Application")
Set message = outlook.createitem(olMailItem)
With message
	.Subject = WScript.Arguments.Item(2)
	.Display
	signature = .htmlbody
	.Recipients.Add WScript.Arguments.Item(1)  ' assume only one recipient
	.Attachments.Add WScript.Arguments.Item(0)
  .htmlbody = WScript.Arguments.Item(3) & vbNewLine & signature
End With
Posted in Uncategorized | Comments Off on Interfacing with a mail client on Windows