Link to home
Start Free TrialLog in
Avatar of Mateen
Mateen

asked on

To send email from within powerbuilder version 7

I am trying to do it first time.

I want to send email from pb7 to Outlook Express

I am trying this via a command button.

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

// Populate the mailMessage structure

mMsg.Subject = 'From Within Powerbuilder'
mMsg.NoteText = 'Luncheon at 12:15'
mMsg.Recipient[1].name = 'mrashid'
mMsg.Recipient[1].address  = "mrashid@siddiqsons.com"

// Send the mail

mRet = mSes.mailSend(mMsg)

IF mRet <> mailReturnSuccess! THEN
            MessageBox("Mail Send", 'Mail not sent')
            RETURN
END IF
mSes.mailLogoff()
DESTROY mSes

First a Choose Profile pop up box comes.  There in the profile name "Outlook" is written. I dont want this pop up box intermediate.

After pressing ok a new pop up box comes and it says
" a program is trying to automatically send email on your behalf. Do you want to allow this. If this is unexpected , it may be a virus and you should choose no"

I choose yes.

I do not want those two pop boxes to come and ask user response.
There is no error message and yet the email has not been delivered.

Please help.
ASKER CERTIFIED SOLUTION
Avatar of sandeep_patel
sandeep_patel
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Also try to send mail directly from outlook. If it fails then it's problem with configuration of outlook.

Sandeep
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Mateen
Mateen

ASKER

Hi,

The mail is being sent now. The only problem is that it asks
  " A program is attempting to send email on your behalf"
I want to suppress this intermediate question. What is the exact configuration place to stop that.
Avatar of Mateen

ASKER

Ok,

I should explore outlook redemption.