1. Brindha Duraisingh
  2. PowerBuilder
  3. Friday, 11 September 2020 06:39 AM UTC

Recently migrated to PB2019 R2 Build 2328 and Outlook 365/Win10

coming across a weird issue with my application exe. works fine in the code. we have a screen in the application to send email on a button click. it creates a local mailsession object and after sending email it destroys the mail session object. This works fine in PB code. I can click 'Send' button any number of times and emails goes through that many times.

But after I build the code, and get a 32-bit exe, I am able to send email only for first time. from second time, I get a success return code from 'mailSend', but email is not sent - it is not in outlook nor sent items. 

code is as below:

lms_session = create mailSession
if lms_session.mailLogon() <> mailReturnSuccess! then
 messageBox("Mail Out", "Unable to connect to e-mail server.")
 return FAILURE
end if


lmr_return = lms_session.mailSend(imm_message)

-----all return codes validated and appropriate message is displayed.

if isValid(lms_session) then

 lms_session.mailLogoff()
 destroy lms_session
end if

 

Has anyone come across this issue. Am I building exe wrong? Issue occurs even on the PC where PB2019 is installed and on client machines.

Accepted Answer
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Friday, 11 September 2020 13:54 PM UTC
  2. PowerBuilder
  3. # Permalink

Hi Brindha;

   Many of our PB customers have encountered this problem when upgrading to OutLook365. The issue seems to be Outlook itself. The workaround we have found that seems to work for most PB Apps is to only perform the MailLogon() and MailLogoff() commands once during the life of the PB App.

HTH

Regards ... Chris

Comment
  1. Chris Pollach @Appeon
  2. Sunday, 13 September 2020 15:42 PM UTC
Please check whether your using PB App is using "Simple MAPI" or "Extended MAPI" in 12.6 and if the PB2019 apps are using the same setting.
  1. Helpful
  1. Brindha Duraisingh
  2. Friday, 2 October 2020 08:01 AM UTC
Chris - performing the MailLogon() and MailLogoff() commands once during the life of the PB App is the only solution that solved my problem.

Thanks much for your answer.
  1. Helpful
  1. Armeen Mazda @Appeon
  2. Thursday, 8 July 2021 04:36 AM UTC
Thanks Brindha for confirming the solution!
  1. Helpful
There are no comments made yet.
Guillermo Tamburo Accepted Answer Pending Moderation
  1. Wednesday, 4 January 2023 16:44 PM UTC
  2. PowerBuilder
  3. # 1

I want to send an email, it creates the section correctly and then it gives an error in the loggon. Below are the sentences of the program. The email account is configured in Outlook and with this application I send and receive emails perfectly.
If someone can guide me where my problem may be, I would appreciate it.

 

mailSession mSes
mailReturnCode mRet
mailMessage mMsg
mailFileDescription mAttach

// Create a mail session
mSes = CREATE mailSession

// Log on to the session
mRet = mSes.mailLogon(MailNewSessionWithDownLoad!)
IF mRet <> mailReturnSuccess! THEN 
    MessageBox("Mail", 'Logon failed.')
   RETURN
END IF

 

 

 

Thanks

Comment
There are no comments made yet.
Brindha Duraisingh Accepted Answer Pending Moderation
  1. Friday, 2 October 2020 08:00 AM UTC
  2. PowerBuilder
  3. # 2

Chris - performing the MailLogon() and MailLogoff() commands once during the life of the PB App is the only solution that solved my problem.

Thanks much for your answer.

Comment
  1. Chris Pollach @Appeon
  2. Friday, 2 October 2020 13:21 PM UTC
Hi Brindha;

That is great news ... I am super glad that this resolved your email issues!

Regards ... Chris
  1. Helpful
  1. erwin monreal
  2. Thursday, 8 July 2021 03:18 AM UTC
hi. I am getting the exact same issue with PB2019 R2. The solution given is not really the correct solution because something working in 2017 was broken in 2019 and recoding the app to work around the bug is not the way to go. Will there be a proper solution anytime soon?
  1. Helpful
  1. Ashok Pattanaik
  2. Monday, 9 August 2021 13:18 PM UTC
I am also experiencing the same issues. It is working in 2017 but doesn't working in PB2019 R2. Something broken.
  1. Helpful
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Saturday, 12 September 2020 03:25 AM UTC
  2. PowerBuilder
  3. # 3

Have you checked if the sent email is "stuck" in the Outbox?

That's a know problem.

Comment
  1. Brindha Duraisingh
  2. Sunday, 13 September 2020 15:24 PM UTC
hi.. No, it doesn't reach the outlook at all. not in outbox/sent items or not reaching the TO/CC/BCC emailbox
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.