P
Peter Hibbs
I am using MS Access 2003 to send an email via Outlook 2003 using
Redemption to prevent the security messages on Windows XP. The basic
(cut down) code is shown below :-
Dim SafeItem, oItem
Dim Application As Outlook.Application
Set Application = CreateObject("Outlook.Application")
Set SafeItem = CreateObject("Redemption.SafeMailItem") Set
oItem = Application.CreateItem(0) SafeItem.Item = oItem
SafeItem.Subject = vSubject
SafeItem.To = vRecipients
SafeItem.Body = vBody
SafeItem.Send
The string variables vSubject, vRecipients and vBody obviously holds
the relevant text. I have also omitted some error checking code in the
interests of clarity.
The code is part of a MS Access application and works perfectly when
Outlook is running at the same time. If, however, Outlook is NOT
running the code fails at the SafeItem.Send command with an error
that just says 'The server threw an exception' and Outlook does not
close down properly, I have to forcibly close it with the Windows Task
Manager.
The Redemption.dll file is located in the C:\WINDOWS\System32 folder
and has been registered with RegSvr32.exe. A reference to the .dll
file has been enabled in Access.
Is there any way I can run this code without having to run Outlook
first?
Peter Hibbs.
Redemption to prevent the security messages on Windows XP. The basic
(cut down) code is shown below :-
Dim SafeItem, oItem
Dim Application As Outlook.Application
Set Application = CreateObject("Outlook.Application")
Set SafeItem = CreateObject("Redemption.SafeMailItem") Set
oItem = Application.CreateItem(0) SafeItem.Item = oItem
SafeItem.Subject = vSubject
SafeItem.To = vRecipients
SafeItem.Body = vBody
SafeItem.Send
The string variables vSubject, vRecipients and vBody obviously holds
the relevant text. I have also omitted some error checking code in the
interests of clarity.
The code is part of a MS Access application and works perfectly when
Outlook is running at the same time. If, however, Outlook is NOT
running the code fails at the SafeItem.Send command with an error
that just says 'The server threw an exception' and Outlook does not
close down properly, I have to forcibly close it with the Windows Task
Manager.
The Redemption.dll file is located in the C:\WINDOWS\System32 folder
and has been registered with RegSvr32.exe. A reference to the .dll
file has been enabled in Access.
Is there any way I can run this code without having to run Outlook
first?
Peter Hibbs.