I have this other problem with MAPI with the code below:
mailSession mSes
mailReturnCode mRet
mailMessage mMsg
// Create a mail session
mSes = create mailSession
// Log on to the session
mRet = mSes.mailLogon(mailNewSession!)
IF mRet <> mailReturnSuccess! THEN
MessageBox("Mail", 'Logon failed.')
RETURN
END IF
the code below always displays Logon failed. no matter what
I do.
Again, this is in PB10 evaluation version. Any ideas would
be much appreciated. thanks.
Neil
http://www.dimastr.com/redemption/
a.
If you have some code snippet, please share it with me.
Thanks.
Neil
http://www.experts-exchange.com/Programming/Programming_Languages/PowerBuilder/Q_21618118.html
------------------------------------------------------------------------
oleOutlook = create oleobject
rc = oleOutlook.ConnectToNewObject("outlook.application")
If rc = 0 Then
oleNameSpace = oleOutlook.GetNameSpace("MAPI")
oleNameSpace.Logon("", "", true, true)
oleSafeMailItem = create oleobject
rc =
oleSafeMailItem.ConnectToNewObject("Redemption.SafeMailItem")
If rc = 0 Then
oleTmp = create oleobject
oleTmp = oleOutlook.CreateItem(0)
oleSafeMailItem.Item = oleTmp
oleSafeMailItem.Recipients.Add(ls_sendto)
oleSafeMailItem.Recipients.ResolveAll
oleSafeMailItem.Subject = ls_subject
oleSafeMailItem.Send
Else
MessageBox("Mail Error", &
"Your email could not be sent. Please contact
IT.~r~n" + &
"The SafeMailItem - ConnectToNewObject~r~n" + &
"failed with a return code of " + String(rc) +
".", &
StopSign!, &
Ok!)
End If
Else
MessageBox("Mail Error", &
"Your email could not be sent. Please contact
IT.~r~n" + &
"The Outlook Application - ConnectToNewObject~r~n" + &
"failed with a return code of " + String(rc) + ".", &
StopSign!, &
Ok!)
End If
------------------------------------------------------------------------
a.