We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you a podcast all about Citrix Workspace, moving to the cloud, and analytics & intelligence. Episode 2 coming soon!Listen Now

x

To send email from within powerbuilder version 7

Mateen
Mateen asked
on
Medium Priority
2,003 Views
Last Modified: 2013-12-26
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.
Comment
Watch Question

Hi,

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.

Regards,
Sandeep

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Also try to send mail directly from outlook. If it fails then it's problem with configuration of outlook.

Sandeep

Author

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

Author

Commented:
Ok,

I should explore outlook redemption.

Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.