This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Adding an attachment to a notification VBScript

Hi, I am trying to create a script that attaches an M-Files generated document to an email notification. Normal email scripts don't seem to work with our servers, so I was wondering if it is possible to download a document from M-Files and attach it to a notifications via a workflow state script with VBScript? I have attached the the piece of code that I would like to use to send the email notification (and attachment) below.

Thanks

Option Explicit

' User or user group recipients from the vault
Dim oUsers : Set oUsers = CreateObject("MFilesAPI.UserOrUserGroupIDs")

Dim oUser : Set oUser = CreateObject("MFilesAPI.UserOrUserGroupID")
oUser.UserOrGroupID = 1	' User ID 32
oUser.UserOrGroupType = MFUserOrUserGroupType.MFUserOrUserGroupTypeUserAccount

oUsers.Add -1, oUser

' External recipients
Dim oExternalUsers : Set oExternalUsers = CreateObject("MFilesAPI.Strings")
oExternalUsers.Add -1, "khoendib@documentwarehouse.com.na"

Vault.NotificationOperations.SendCustomNotification oUsers, False, oExternalUsers, True, "Test email", "Test email body"

Parents
  • Hi Kay_G,

    As far as I know API VaultNotificationOperations, there is no method for attachments. If the CDO script is used needs to be sent via SMTP relay that allows the M-Files server to send without authentication or to review the CDO script settings and configure it with a username and password.

    Тhe other option is what Radu has offered.

Reply
  • Hi Kay_G,

    As far as I know API VaultNotificationOperations, there is no method for attachments. If the CDO script is used needs to be sent via SMTP relay that allows the M-Files server to send without authentication or to review the CDO script settings and configure it with a username and password.

    Тhe other option is what Radu has offered.

Children