How do I use the Redemption with MAPI installed to send email?

I would like some help on how to use this function. I keep getting the following error messages [Collaboration Data Objects - [MAPI_E_NOT_FOUND(8004010F)]] Which indicate that the user failed to log into the server.

We have spent too much time,Can anyone help?
Would really, really appreciate it.

Some Description:

We are trying to impersonate the main account (which has sufficient access to the other exchange servers email accounts) to give the ability to send as these accounts.

Note: The ExchangeMapiCdo.exe is installed and Redemption has been registered.
The account is the Domain and User account.

the identity inpersonation in the web.config is as follow:

    <authentication mode="Windows"/>
    <identity impersonate="true" userName="DomainName\UserAccount" password="PSW"/>    

the following code in the web service is:

        Dim objSession As Object
            Dim ExchangeServer As String = String.Empty
            Dim objREDSession As New Redemption.RDOSession
            Dim bstrProfileInfo As String = String.Empty
            Dim SafeItem As Object

            objREDSession.LogonExchangeMailbox("UserAccount", "ServerName")<<<<<<<<< It is failing on this.

            SafeItem = objREDSession.GetDefaultFolder(9).Items.Add
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Éric MoreauSenior .Net ConsultantCommented:
RDO is not the prefered method of sending emails in .Net.

newbie_girlAuthor Commented:
Thank you for the response and I am taking your suggestion on board.  We have requested from our Service Provider to install and configure the outlook on the test server. I will let you know as soon as everything has been implemented and tested.

Would be appreciate if there is there another suggestion to concede.
Éric MoreauSenior .Net ConsultantCommented:
>> We have requested from our Service Provider to install and configure the outlook on the test server

It is not Outlook that you need on the server, you need a SMTP server.
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

newbie_girlAuthor Commented:

I have used the following code and published to the test environment which does not have outlook installed. Microsoft.Office.Interop.Outlook.dll is attached to the service.
The IIS 7.0 - SMTP E-mail for the service been configured to look at the exchange server.

        Dim strRecipient As String = "my email"
        strSubject = "Test"
        strBody = "Test Test"
        Dim dtStartDate As Date = Date.Now
        Dim intReminder As Object = Nothing
        Dim intDuration As Object = Nothing

        Dim ObjApplication As New Outlook.Application
        Dim ObjNamespace As Outlook.NameSpace
        Dim objFolder As Outlook.MAPIFolder
        Dim ObjRecipient As Outlook.Recipient
        Dim ObjApplicationt As Outlook.AppointmentItem
        Dim apptDate As Date
        Dim strContact As String
        ObjApplication = CreateObject("Outlook.Application")
        ObjNamespace = ObjApplication.GetNamespace("MAPI")

        ObjRecipient = ObjNamespace.CreateRecipient(strRecipient)
        objFolder = ObjNamespace.GetSharedDefaultFolder(ObjRecipient, olFolderCalendar)
        If Not objFolder Is Nothing Then
            ObjApplicationt = objFolder.Items.Add
            If Not ObjApplicationt Is Nothing Then
                With ObjApplicationt
                    .strSubject = strSubject
                    .strBody = strBody
                    .Start = dtStartDate
                    If Not (intReminder Is Nothing) Then
                        .ReminderSet = True
                        .intReminderBeforeStart = intReminder
                    End If
                    If Not (intDuration Is Nothing) Then
                        .intDuration = intDuration
                        .intDuration = 10
                    End If
                End With
            End If
        End If

        ObjApplication = Nothing
        ObjNamespace = Nothing
        objFolder = Nothing
        ObjRecipient = Nothing
        ObjApplicationt = Nothing

the error:

System.ServiceModel.FaultException`1[System.ServiceModel.ExceptionDetail]: Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)). (Fault Detail is equal to An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is: System.Runtime.InteropServices.COMException: Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)). at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache) at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean skipCheckThis, Boolean fillCache) at System.Activator.CreateInstance(Type type, Boolean nonPublic) at System.Activator.CreateInstance(Type type) at EmailCalendarService.Service1.SendMeetingRequestWithImpersonation(String strOffice, String strConta...).

Please advise.
Éric MoreauSenior .Net ConsultantCommented:
You haven't taken that from my code for sure. why don't you just use System.Net.Mail?

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
newbie_girlAuthor Commented:

Apology for late response

Thank you for your suggestion. However we are trying to send the meeting request directly to the user without attaching it to an email.
Different users should perform the above functionality concurrently from the same and different accounts.

Our tests until now are as follow:
•      Using the outlook object is forcing the outlook application open and close each time the meeting request is preformed. It may throw MAPI error for the request if one request has not preformed or closed properly. We are still performing tests on this. Any suggestion will be helpful.
•      Using redemption and impersonation is giving us good results when concurrent request have been performed from the same account. However, error will be thrown when the request performed concurrently from different account.
•      Using redemption and identity impersonation (web.config) fails on the exchange logon function.

Please advise.
newbie_girlAuthor Commented:

Thank you for your help. We have followed your advice (System.Net.Mail) and we have done load testing and the outcomes were rally good.
Refer to the following link for the code. 
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.