property Message.Attachment as String

Retrieves or sets a value that indicates the list of message' attached files separated by semicolon.

TypeDescription
String A String expression that indicates the files to attach as:
  • a list of files (including the full path) to attach, separated by semicolon
  • a multi-line string defining the file name to attach, with subsequent lines specifying the content of the file to attach (ability to attach a file with its content without physically having it)

To include attachments in your email message, there are two methods you can use:

Both approaches provide flexibility in how you attach files to your emails, depending on your specific programming or email sending scenario.

The following method shows two different ways how you can attach files to a Message object:

Private Sub Form_Load()
    Dim m As Message
    Set m = Runtime1.NewMessage
    If (0 = m.Send("myaccount@usermail.com", "sss@colam.com", "Test", "This is a test message", "c:\winnt\system32\setup.exe;c:\winnt\system32\setup.bin")) Then
        MsgBox "The message was succesfully delivered "
    End If
End Sub
Private Sub Form_Load()
    Dim m As Message
    Set m = Runtime1.NewMessage
    m.Attachment = "c:\winnt\system32\setup.exe;c:\winnt\system32\setup.bin"
    If (0 = m.Send("myaccount@usermail.com", "sss@colam.com", "Test", "This is a test message")) Then
        MsgBox "The message was succesfully delivered "
    End If
End Sub