Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

MailLogon fail

173 views
Skip to first unread message

neilgarcia

unread,
Aug 6, 2007, 9:31:27 PM8/6/07
to
Hi,

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

Adam Simmonds [TeamSybase]

unread,
Aug 6, 2007, 10:11:44 PM8/6/07
to
This is not an answer to your question but you should probably look at
using this redemption dll to interact with outlook. You will have
problems with security if you continue down the path you are heading.

http://www.dimastr.com/redemption/

a.

neilgarcia

unread,
Aug 7, 2007, 1:34:56 AM8/7/07
to
I am exploring redemption dll now ( I have installed it as
instructed) but I really could not start. Don't know where
to start. There are sample scripts on VB but I could not
convert it to PB. Can you guide me thru just to start it?

If you have some code snippet, please share it with me.
Thanks.

Neil

Adam Simmonds [TeamSybase]

unread,
Aug 7, 2007, 2:25:13 AM8/7/07
to
I cant find some old code where I used it but a google search yielded a
decent example.

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.

neilgarcia

unread,
Aug 7, 2007, 11:36:49 PM8/7/07
to
Great. Thank you very much for the help.
0 new messages