Discussion:
Email "hijacked"
(too old to reply)
Homer J. Simpson
2005-06-15 15:04:23 UTC
Permalink
Hi all,

I have a small application that runs on a user's machine, sends an email
through MAPI, then shuts down. It simply calls MAPILogon(), MAPISendMail(),
and MAPILogoff() for the whole operation.

The email itself has a recipient, a subject line, and a file attachment.
There's no message body.

I have a customer who claims the following:

- he runs my application (actually, the application runs from a login
script)
- presumably my email is still sitting in his Outbox, if it hasn't been sent
already
- a while later, he starts to compose an email
- the bewildering part of his claim is that while composing the email, the
window somehow gets "hijacked" and closes down. Then in his Sent Items
folder, he sees my program's message, with my subject line, my file
attachment, but the body of the email he was in the middle of composing (!).

It sounds to me like, as he's composing his email, the items in the Outbox
get processed (presumably by some background thread), and when *that*
happens, GroupWise somehow manages to mess things up. I'm wondering if the
fact that my message has no body may confuse GW.

I can only speculate at this point. Anybody have thoughts?
Homer J. Simpson
2005-06-16 20:03:05 UTC
Permalink
FYI, I've got some more feedback on this:

The client is actually composing his email when my app is running. When my
app calls MAPISendMail(), GroupWise creates a new window, fills in the
recipient, the subject line, etc. When the email is sent, that window
closes.

What apparently is going on is that while that window is opened, the user
sets focus back to his email, and GroupWise then starts sending "keystrokes"
to whatever window currently has focus...thus his claim of having his window
"taken over"...

Is it just me, or it is a really, really bad design to have an interactive
window pop up and steal away the focus when a third-party application calls
MAPI?

Other thoughts...?
Tommy Mikkelsen
2005-06-16 20:39:28 UTC
Permalink
Drop the MAPI stuff and spawning a window, cuz that's bad design.

Use the ObjectAPI instead, and look @ the Message object
--
Best Regards

Tommy Mikkelsen

IT Quality A/S
Denmark

Novell Support Forums SYSOP

Please Report back any success or failure, That way we all learn

Sorry, but no support through email

"I hate bugs".......Tommy Lee Jones, MIB
Homer J. Simpson
2005-06-17 13:49:26 UTC
Permalink
Post by Tommy Mikkelsen
Drop the MAPI stuff and spawning a window, cuz that's bad design.
Yeah, but whose bad design it is? I have the exact same code calling many
different implementations of MAPI, Groupwise is the only instance that
spawns a window.
Tommy Mikkelsen
2005-06-18 13:06:57 UTC
Permalink
Didn't say, that GW API's was great ;-)

Just said, that going towards GW, you might benifite from using native
API's
--
Best Regards

Tommy Mikkelsen

IT Quality A/S
Denmark

Novell Support Forums SYSOP

Please Report back any success or failure, That way we all learn

Sorry, but no support through email

"I hate bugs".......Tommy Lee Jones, MIB
Homer J. Simpson
2005-06-20 13:18:37 UTC
Permalink
Post by Tommy Mikkelsen
Didn't say, that GW API's was great ;-)
Just said, that going towards GW, you might benifite from using native
API's
:-D

I downloaded the ObjectAPI samples. The damned thing can't send mail at
all, while my app using MAPI can do it without a problem (that is, excluding
that problematic window).

I'm not getting any error message or anything of that nature at any point as
I'm stepping through the sample's code. Everything behaves as if it's being
successfully sent, the other end just never receives anything. I'm less
than impressed.
Tommy Mikkelsen
2005-06-20 14:24:42 UTC
Permalink
Post by Homer J. Simpson
Post by Tommy Mikkelsen
Didn't say, that GW API's was great ;-)
Just said, that going towards GW, you might benifite from using
native API's
:-D
I downloaded the ObjectAPI samples. The damned thing can't send mail
at all, while my app using MAPI can do it without a problem (that is,
excluding that problematic window).
I'm not getting any error message or anything of that nature at any
point as I'm stepping through the sample's code. Everything behaves
as if it's being successfully sent, the other end just never receives
anything. I'm less than impressed.
Works fine for me :-)
--
Best Regards

Tommy Mikkelsen

IT Quality A/S
Denmark

Novell Support Forums SYSOP

Please Report back any success or failure, That way we all learn

Sorry, but no support through email

"I hate bugs".......Tommy Lee Jones, MIB
Michael Bell
2005-06-20 19:55:28 UTC
Permalink
Then bluntly you are doing something wrong. I've used the GW object api to
send mail in commercial products for 7 years now.

Spit out some code, and maybe we can offer suggestions
--
Post by Homer J. Simpson
Post by Tommy Mikkelsen
Didn't say, that GW API's was great ;-)
Just said, that going towards GW, you might benifite from using native
API's
:-D
I downloaded the ObjectAPI samples. The damned thing can't send mail at
all, while my app using MAPI can do it without a problem (that is,
excluding that problematic window).
I'm not getting any error message or anything of that nature at any point
as I'm stepping through the sample's code. Everything behaves as if it's
being successfully sent, the other end just never receives anything. I'm
less than impressed.
Homer J. Simpson
2005-06-22 14:13:59 UTC
Permalink
Post by Michael Bell
Then bluntly you are doing something wrong. I've used the GW object api to
send mail in commercial products for 7 years now.
Spit out some code, and maybe we can offer suggestions
It's not even my code. I'm just trying out the ObjectAPI sample (that gets
installed to ndk\ObjectAPI\sample\MAIL\CPP) before I commit to writing my
own. I compile it, step through the code from start to finish, no error
code is ever returned, but no email is ever received...

Normally under those circumstances I'd say the environment isn't set up
correctly, but again, that machine can send mail through MAPI...if the
machine has the proper settings to successfully send things out through
GroupWise's implementation of MAPI, then surely it should also be able to
send things out through the COM interface...?

I just had another look at the sample's files. I haven't modified
anything--the only files that don't have a date of 3/3/2005 are the .dsw and
.dsp files (I'm using VC6), and the .rc file (I had to resize the sample's
"To" field so I could type in the recipient's email address--it initially
wasn't wide enough).

If something jumps out at you, I'm all ears...

Continue reading on narkive:
Loading...