have redemption installed on a Windows Server 2022 (tried Windows Server 2019 as well). In our code, we create the OLE object (no issues), add attachment(s), again no issues, then we call the safeitem.recipients.add( ‘[email protected]’ ). This fails and shows “invalid message” as the failure.
We we use the code on a non-server system, ie: Windows 10, Windows 11, no issues. Any ideas?
Thanks in advance
David Gauthier
searched web, cannot find any issues related to this
code snippet;
int li_ret
long i, ll_pos0, ll_pos
long llReturn
string ls_recipient, ls_error_message
OLEObject oleSafeItem
OLEObject lole_session, lole_msg, lole_attach
is_redemption_error_message = ''////CMD 8.18.2017 WO-9408 - SMARTsoft Compatibility Test
TRY
lole_session = create oleobject
llReturn = lole_session.ConnectToNewObject("outlook.application")
yield()
if llReturn = 0 then
oleobject ole_namespace
ole_namespace = lole_session.GetNamespace('MAPI')
ole_namespace.Logon
oleSafeItem = CREATE OLEObject
llReturn = oleSafeItem.ConnectToNewObject( "Redemption.SafeMailItem")
yield()
if llReturn = 0 then
lole_msg = CREATE OLEObject
lole_msg = lole_session.CreateItem(0)
yield()
oleSafeItem.Item = lole_msg
lole_attach = oleSafeItem.Attachments
for i = 1 to upperbound( as_attachment, 1 )
lole_attach.Add( as_attachment[i] )
next
ll_pos0 = 0
ll_pos = 1
DO WHILE ll_pos > 0
ll_pos = Pos ( as_recipient, ';' ,ll_pos0+1 )
IF ll_pos = 0 THEN
ls_recipient = Mid(as_recipient, ll_pos0+1)
ELSE
ls_recipient = Mid(as_recipient, ll_pos0+1, ll_pos - ll_pos0 - 1)
ll_pos0 = ll_pos
END IF
oleSafeItem.Recipients.Add(ls_recipient) <-- point of failure BUT only on a Windows Server system, as in using RDP session
LOOP
oleSafeItem.Recipients.ResolveAll
8