?
Solved

To send email from within powerbuilder version 7

Posted on 2006-03-21
5
Medium Priority
?
1,954 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.
0
Comment
Question by:Mateen
  • 2
  • 2
5 Comments
 
LVL 14

Accepted Solution

by:
sandeep_patel earned 1000 total points
ID: 16246448
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
0
 
LVL 14

Expert Comment

by:sandeep_patel
ID: 16246476
Also try to send mail directly from outlook. If it fails then it's problem with configuration of outlook.

Sandeep
0
 
LVL 18

Assisted Solution

by:diasroshan
diasroshan earned 1000 total points
ID: 16246498
0
 

Author Comment

by:Mateen
ID: 16254206
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.
0
 

Author Comment

by:Mateen
ID: 16254216
Ok,

I should explore outlook redemption.

0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In our object-oriented world the class is a minimal unit, a brick for constructing our applications. It is an abstraction and we know well how to use it. In well-designed software we are not usually interested in knowing how objects look in memory. …
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org Go to that link and select download selenium in the right hand column That will then direct you to their download page. From that p…
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.
Suggested Courses

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question