1. Vipul Prakash Srivastava
  2. PowerBuilder
  3. Thursday, 7 January 2021 06:12 AM UTC

Our PB code in 2017 R3 was migrated to windows 10 environment. mail functionality which was working on Win7 no longer works on Outlook 365 (Outlook for Office 365 MSO (16.0.10730.20155)).

We get Microsoft Outlook Error

"Login Failed"

Our code looks like this;

// Create a mail session
mSes = create mailSession

// Log on to the session
mRet = mSes.mailLogon("Default","")

IF mRet <> mailReturnSuccess! THEN
mRet = mSes.mailLogon(mailNewSession!)
IF mRet <> mailReturnSuccess! THEN
MessageBox("Mail", 'Logon failed.')
RETURN
END IF
END IF

 Things tried:

Outlook is open all the time,I tried setting Outlook as default through settings,

Added  [PB]
UseSimpleMAPI=yes

to pb.ini, but no luck.

WorkAround or Analysis :On windows 7 we were using outlook 32 bit component so our Application was running fine, Now I checked on Windows 10 Operating System by default Outlook installed with 64 bit component , so now our PB code which is deployed on Appeon PB 2017 R2 which is 32 bit component , and 32 bit component is not compatible with outlook 64 bit component. that's why error is coming.

Please help me to resolve this issue.

Regards

Vipul Srivastava

Accepted Answer
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 25 August 2021 17:31 PM UTC
  2. PowerBuilder
  3. # Permalink

Hi Vipul ;

  If your MS-Exchange MAIL client software is using a 64bit client then you have two choices ...

1) Compile your PB App into a 64bit EXE

2) Create a new 64bit PB App EXE to "interface" to the Outlook 64 bit client. Then call the 64bit App Outlook "interface" from your 32bit PB App EXE to perform any Outlook 365 requests.

Regards ... Chris

 

Comment
There are no comments made yet.
Vipul Prakash Srivastava Accepted Answer Pending Moderation
  1. Monday, 11 January 2021 09:19 AM UTC
  2. PowerBuilder
  3. # 1

Hi Pierre,

 

I tried with below code example:

// declare OleObject variable and Constant Variable 
 oleobject oleOutlook 
 oleobject oleAppt 
 Constant Integer olAppointmentItem = 1 
  
 // create the Object 
 oleOutlook = create oleobject 
 
  // Connect To the Outlook Object 
 oleOutlook.ConnectToNewObject ('Outlook.Application') 
 
 // Create the Appointment Object 
oleAppt = oleOutlook.CreateItem (olAppointmentItem) 
 

// Set some common properties of Appointment Object 
  oleAppt.Location = "Home" 
  oleAppt.Subject = "Test" 
  oleAppt.Start = "01/10/2021 19:00" 
  oleAppt.ReminderMinutesBeforeStart = 1 // in minute 
  oleAppt.Duration = 120 // in minute 
  oleAppt.Body = "Go MU !!! Go !!!" 
  // Save the Appointment 
  oleAppt.Save

and I can access outlook with PB32 bit and i can able to  open meeting reminder box successfully with the help of above code. Now I need to open Recipient address list , so code you please help me or give me some example so I can implement it.

Please help  me.

Thanks

Vipul

Comment
There are no comments made yet.
Pierre Couvreur Accepted Answer Pending Moderation
  1. Thursday, 7 January 2021 10:51 AM UTC
  2. PowerBuilder
  3. # 2

Hello,

You could use an Ole Object to connect to Outlook.application then create and send a mail item.

Pierre

Comment
  1. Floyd Edwards
  2. Wednesday, 25 August 2021 17:25 PM UTC
How would you create an email? Can't find documentation on it.
  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.