Hi Helmut
Many thanks for that. I added outlook 10 and redemption.dll references under
COM. Would this not be enough for vs.net to automatically generate interop
dlls?
My code with slight modifications is given below. I am getting the error at
the specified line. Any idea what I am doing wrong?
Thanks
Regards
Imports Outlook
Imports Redemption
Public Class Form1
Inherits System.Windows.Forms.Form
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
Dim objApp As Outlook.Application
Dim objNS As Outlook.NameSpace
Dim objSafeItem As Redemption.SafeMailItem
Dim objMailItem As Outlook.MailItem
objApp = New Application
objNS = objApp.GetNamespace("MAPI")
objNS.Logon("Outlook", "", False, False)
objMailItem = objApp.CreateItem(OlItemType.olMailItem)
objSafeItem = New SafeMailItem
objSafeItem.Item = objMailItem
objSafeItem.Recipients.Add("
[email protected]")
objMailItem.Subject = "TestMessage"
objSafeItem.Body = "TestMessage"
objSafeItem.Send() ' <=== ERROR HERE:
System.Runtime.InteropServices.COMException (0x80040607): Could not submit
the message - error 0x80040607
objSafeItem = Nothing
objMailItem = Nothing
objNS.Logoff()
objNS = Nothing
objApp = Nothing
End Sub
End Class