Mark Sreeves
May 2nd, 2000, 07:42 PM
This just uses the Active Messaging: Olemsg32.dll
Private Sub EmailMessage()
Dim oSession As MAPI.Session
Dim oMessage As MAPI.message
Dim oRecipient As MAPI.Recipient
Set oSession = CreateObject("MAPI.Session")
oSession.Logon 'this will promt for a profile. This can be avoided by including the profile name
Set oMessage = oSession.Outbox.Messages.Add
With oMessage
.Subject = "email from " & App.Title
.Text = "This is a test message"
.Attachments.Add "c:\yourFile.txt"
Set oRecipient = oMessage.Recipients.Add
oRecipient.Name = "someone@somewhere"
oRecipient.Resolve
.Update
.Send
End With
oSession.Logoff
Set oSession = Nothing
Set oMessage = Nothing
Set oRecipient = Nothing
End Sub
[Edited by Mark Sreeves on 05-12-2000 at 12:39 PM]
Private Sub EmailMessage()
Dim oSession As MAPI.Session
Dim oMessage As MAPI.message
Dim oRecipient As MAPI.Recipient
Set oSession = CreateObject("MAPI.Session")
oSession.Logon 'this will promt for a profile. This can be avoided by including the profile name
Set oMessage = oSession.Outbox.Messages.Add
With oMessage
.Subject = "email from " & App.Title
.Text = "This is a test message"
.Attachments.Add "c:\yourFile.txt"
Set oRecipient = oMessage.Recipients.Add
oRecipient.Name = "someone@somewhere"
oRecipient.Resolve
.Update
.Send
End With
oSession.Logoff
Set oSession = Nothing
Set oMessage = Nothing
Set oRecipient = Nothing
End Sub
[Edited by Mark Sreeves on 05-12-2000 at 12:39 PM]