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.')

// Populate the mailMessage structure

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

// Send the mail

mRet = mSes.mailSend(mMsg)

IF mRet <> mailReturnSuccess! THEN
            MessageBox("Mail Send", 'Mail not sent')

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.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.


I think first you need to configure your Outlook and make Outlook as your default mail client. Then it will not ask for the profiles to select.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Also try to send mail directly from outlook. If it fails then it's problem with configuration of outlook.

MateenAuthor Commented:

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.
MateenAuthor Commented:

I should explore outlook redemption.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Editors IDEs

From novice to tech pro — start learning today.