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

x
?
Solved

How can I send a mail modelessly?

Posted on 1998-09-23
14
Medium Priority
?
321 Views
Last Modified: 2013-11-19
Our program gives user a way to send a mail message. Currently we use MAPISendMail function from MAPI32.DLL.
But in that way of sending mail I get a mail message window modal for my application, so can't do anything until I close the message window.
How can I send a mail modelessly, in the way Word does it?
0
Comment
Question by:Moshe072898
[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
  • 5
  • 4
  • 4
  • +1
14 Comments
 
LVL 6

Expert Comment

by:thresher_shark
ID: 1322499
Creating a separate thread might work.  Look into the function AfxBeginThread.
0
 
LVL 8

Expert Comment

by:Answers2000
ID: 1322500
I don't think they are using the simple MAPI functions in MS Word or ther other MS office apps.

There's a MAPI (without the word simple - and rightly so) which has a COM interface.  I think Word, Excel etc. use this.
0
 
LVL 1

Expert Comment

by:kumarana
ID: 1322501
I think a simpler method could be to use socket and
use port 25.
use the SMTP protocol and send the message.

If you want to send attacments then in www.codeguru.com
you find MFC code to send attachments through sockets.

That code is real cool and it can save you a lot of work.
all the best
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:Moshe072898
ID: 1322502
Thank  you , kumarana,
But I don't think the method you suggested suits me. I'd like to have all that UI that MAPI gives. I just wanted it to work modelessly.
I'll try a suggestion of thresher_shark.
I also think that Answer2000 is right and there is a MAPI with COM interface. If someone knows where is a sample of its using, please let me know.
0
 
LVL 8

Expert Comment

by:Answers2000
ID: 1322503
Docs in Platform SDK

MSDN:
Platform SDK, and DDK Documentation / Platform SDK / Database and Messaging Services / Win32 Messaging (MAPI)

It's actually "COM like" as it was devised before COM was complete, so it has a few funnies.  Samples like there.  Third party samples are thin on the ground.
0
 
LVL 8

Expert Comment

by:Answers2000
ID: 1322504
BTW a good work round with simple MAPI is to create a 2nd program with just the dialog (and say command line params), then

1. Prog A writes out file to send
2. Prog A runs Prog B
3. Prog B brings up send mail dlg
4. Prog A then continues happily on
0
 

Author Comment

by:Moshe072898
ID: 1322505
Excuse me, kumarana for rejecting your answer. See my previous comment for reasons.
Answers2000, don't you think that you last comment contains the same idea   thresher_shark proposed, but in more complicated form? I tried this (thread)  and it works good enough except  for "minimize" button that still does not work. But I suspect that there are some Microsoft implementation tricks. If someone knows how to work around this - please let me know.
I want to give points to  thresher_shark, I just don't know how to do it.
0
 
LVL 8

Expert Comment

by:Answers2000
ID: 1322506
Well it's not exactly the same, because I just wanted to make clear you don't have to create a thread.

Thresher needs to look the question, then you can grade his answer to give him the pts
0
 
LVL 8

Expert Comment

by:Answers2000
ID: 1322507
Well it's not exactly the same, because I just wanted to make clear you don't have to create a thread.

Thresher needs to lock the question, then you can grade his answer to give him the pts
0
 
LVL 6

Accepted Solution

by:
thresher_shark earned 200 total points
ID: 1322508
Thank you, Moshe, I didn't think that my comment would help you, but I guess it does.  Can you please elaborate on the minimize-button-not-working problem?  Perhaps we can help you with that too.
0
 

Author Comment

by:Moshe072898
ID: 1322509
Well, Thresher, points are yours.
What about minimize button,  it's that simple like it sounds - when you press it , it does nothing.
0
 
LVL 6

Expert Comment

by:thresher_shark
ID: 1322510
>> points are yours
Did you forget to grade me? :-)

About the minimize button... what about the other buttons in the corner, the maximize and the close button.  Do they work?  Also, is the minimize button enabled or disabled?
0
 

Author Comment

by:Moshe072898
ID: 1322511
Don't worry about the points - they are yours and only yours. But if I accept your answer - you won't be able to add comments.
If you have nothing to add - I accept your answer immediately.
As for the button - it is enabled, can be pressed, two others work perfectly.
0
 
LVL 6

Expert Comment

by:thresher_shark
ID: 1322512
Wow that is strange.  I do not know the answer.  Perhaps you could post another question in the MFC area and others who know more about MFC could help you (I am not a real expert on the subject, see profile) :-).  Good luck and thanks for the points.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…

604 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