Link to home
Start Free TrialLog in
Avatar of bboo
bboo

asked on

Send email using VB .net using RDO with Redemption.dll

I am using the following VB .NET code to create an email with voting options. I am using the Redemption.dll so that I can bypass the security prompt. The code had worked at one point but now I'm getting the error noted below. I had set up another profile on outlook so that I could logon as a different user. This may have caused the error, not sure.

References to:
Outlook
Redemption

Private Sub TESTRDO()

        Dim Session As Redemption.RDOSession
        Dim Mail As Redemption.RDOMail
        Session = CreateObject("Redemption.RDOSession")
        Session.Logon()

        Mail = Session.GetDefaultFolder(Redemption.rdoDefaultFolders.olFolderInbox)
        Mail.Recipients.Add("eaters@lunch.com")
        Mail.Subject = "Lunch anybody?"
        Mail.Body = "Please open the message and click on one of the buttons"
        ''to indicate your lunch preference"
        Mail.VotingOptions = "Chinese;Italian;Mexican;Don't care"
        Mail.Send()

    End Sub



I get the following error message on this line of code:
        Mail = Session.GetDefaultFolder(Redemption.rdoDefaultFolders.olFolderInbox)

Error message :

An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in CreateTSEmail.exe

Additional information: Error in IMAPISession::OpenMsgStore: 0x8004011D
Error: The information store could not be opened.
Component: MAPI 1.0

Thanks in advance for any help here.
Avatar of theGhost_k8
theGhost_k8
Flag of India image

afaik ur session has some problem i think.
       Dim Mail As Redemption.RDOMail
        Mail = Session.GetDefaultFolder(Redemption.rdoDefaultFolders.olFolderInbox)
How can u assign GetDefaultFolder(...) to Mail...??
GetDefaultFolder(FolderType)
FolderType - integer. The type of default folder to return. Accepts the same values as Namespace.GetDefaultFolder method in Outlook Object Model (olFolderInbox, olFolderContacts, etc).

It Returns RDOFolder object.
and you are assigning it to RDOMail object. WRONG !!!

read more:-
      http://www.dimastr.com/redemption/rdo/rdosession.htm#methods
Avatar of bboo
bboo

ASKER

The solution you suggested still gave me the same error:
This is the exact same code as found on:
 http://www.dimastr.com/redemption/rdo/rdosession.htm#methods


Dim Session As Redemption.RDOSession
        Dim Mail As Redemption.RDOMail
        Dim Inbox As Redemption.RDOFolder
        Session = CreateObject("Redemption.RDOSession")
        Session.Logon()

' The code gives error on the line below
        Inbox = Session.GetDefaultFolder(Redemption.rdoDefaultFolders.olFolderInbox)
        Mail.Recipients.Add("eaters@lunch.com")
        Mail.Subject = "Lunch anybody?"
        Mail.Body = "Please open the message and click on one of the buttons"
        Mail.VotingOptions = "Chinese;Italian;Mexican;Don't care"
        Mail.Send()
CreateTSEmail.exe  ??? is it ur application name?
show whole message.. line number..
try catching exception of type COMException.
ultimate help is this:
dmitry@dimastr.com
Avatar of bboo

ASKER

CreateTSEmail.exe is the application name.
 This is the same message I sent above.

An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in CreateTSEmail.exe

Additional information: Error in IMAPISession::OpenMsgStore: 0x8004011D
Error: The information store could not be opened.
Component: MAPI 1.0
ASKER CERTIFIED SOLUTION
Avatar of bboo
bboo

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
greate