Working with Redemption Dll version 6.3.0.6164
When I try to send a mail from a program, always appears a popup from Outlook asking for the password.
And if i enter the pwd, they ask again, and again, and again …
Here is the code i use :
Dim Sessio As Redemption.RDOSession
Dim Inbox As Redemption.RDOFolder
Dim Msg As Redemption.RDOMail
Dim s As String
Sessio = New Redemption.RDOSession
Sessio.LogonHostedExchangeMailbox(Mailuser, Mailuser, Pwd)
Inbox = Sessio.GetDefaultFolder(Redemption.rdoDefaultFolders.olFolderInbox)
Msg = Inbox.Items.Add
Msg.To = "[email protected]"
Msg.Body = "Test"
Msg.SenderEmailType = "EX"
Msg.Subject = "Test"
Msg.Save()
Msg.Send()
Sessio.Logoff()
Inbox = Nothing
Sessio = Nothing
1
Keep in mind that LogonHostedExchangeMailbox
assumes Basic auth is enabled on the Exchange server, if it is not, all bets are off.
If Outlook is already running and connected to the mailbox in question, you can piggyback on its session. Use the following instead of LogonHostedExchangeMailbox
:
outlook = New Outlook.Application
namespace = outlook.GetNamespace("MAPI")
ns.Logon 'does not do anything if Outlook is already running
Sessio = New Redemption.RDOSession
Sessio.MAPIOBJECT = ns.MAPIOBJECT
Inbox = Sessio.GetDefaultFolder(Redemption.rdoDefaultFolders.olFolderInbox)
4