Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How to prevent Outlook from popping up the address booking when sending an email via Powerbuilder

Posted on 2004-08-27
8
Medium Priority
?
689 Views
Last Modified: 2013-12-26
Hello everyone,

When I connect to Outlook to send an email it pops up the address book even though I am specifying the emails correctly.

Is there a way to prevent this?

Here is my current code:

mailSession mSes

mailReturnCode mRet
mailMessage mMsg
mailFileDescription mAttach

//mMsg.Recipient[1].Address = 'paulericmurray@hotmail.com'
mMsg.Recipient[1].name = 'paulericmurray@hotmail.com'
mMsg.Recipient[1].RecipientType = mailTo!
//mMsg.Recipient[2].Address = 'pemurray@groundtravel.com'
mMsg.Recipient[2].name = 'pemurray@groundtravel.com'
mMsg.Recipient[2].RecipientType      = mailCC!

mAttach.Filename = 'Apollo.doc'
mAttach.Pathname = 'T:\Apollo.doc'
mAttach.FileType = mailAttach!
//mAttach.Position = 1

mMsg.Subject = 'Test Message'
mMsg.NoteText = 'This is the body of mail ~nAuto Generated E-mail by the system'


// Create a mail session
mSes = CREATE mailSession
// Log on to the session
//mRet = mSes.mailLogon(mailNewSession!)

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

mMsg.AttachmentFile[1] = mAttach
IF mRet <> mailReturnSuccess! THEN
     MessageBox("Mail", 'Attachment failed.')
     RETURN
END IF


mRet = mSes.mailAddress(mMsg)
IF mRet <> mailReturnSuccess! THEN
     MessageBox("Mail", 'Addressing failed.')
     RETURN
END IF

// Send the mail
mRet = mSes.mailSend(mMsg)
IF mRet <> mailReturnSuccess! THEN
     MessageBox("Mail", 'Sending mail failed.')
        MessageBox("Mail", String(mRet))

string mailreturnstring
        
        mailreturnstring = MailErrorToString(mRet)
        MessageBox("Email Result", "Email ReturnCode = " + mailreturnstring)
     RETURN
END IF

mSes.mailLogoff()
DESTROY mSes


Thank you in advance for your help.

Paul
0
Comment
Question by:pemurray
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
8 Comments
 
LVL 4

Accepted Solution

by:
falvaro3 earned 1600 total points
ID: 11930761
With the recipient object of the mailitem, try using the Resolve() method to resolve the address before sending.

mMsg.Recipient[1].name = 'paulericmurray@hotmail.com'
mMsg.Recipient[1].RecipientType = mailTo!
IF NOT mMsg.Recipient[1].Resolve THEN
    // Do something about the unresolvable (?) address
END IF
mMsg.Recipient[2].name = 'pemurray@groundtravel.com'
mMsg.Recipient[2].RecipientType     = mailCC!
IF NOT mMsg.Recipient[2].Resolve THEN
    // Do something about the unresolvable (?) address
END IF

hth,
frank
0
 
LVL 4

Expert Comment

by:falvaro3
ID: 11930850
whoopsie.  my bad.  I was using the Recipient object from the Outlook object model (which contains the Resolve() method to resolve addresses from the address book).  Sorry about that (unless, of course, you'd want to do it that way... ;).
0
 
LVL 4

Expert Comment

by:falvaro3
ID: 11930878
There is, however, a mailResolveRecipient() PowerScript method of the mailSession object in Powerbuilder which resolves usernames.  Not sure if it resolves qualified addresses, though.
0
 
LVL 4

Expert Comment

by:falvaro3
ID: 12173613
I would lean toward my 8/30/2004 comment as a possible suggestion for a solution, since the code was dealing with the mailSession object in PB, and the mailResolveRecipient() is a valid method of that object.
I would like to hear from the original poster first, of course.
10-q, fa
0
 

Author Comment

by:pemurray
ID: 12173935
Sorry, I was sure that I tried that but I will check it out again tonight.  Thank you, Paul
0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

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. …
Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

610 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