Solved

How can I send a mail modelessly?

Posted on 1998-09-23
14
316 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
Industry Leaders: 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!

 

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 50 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

Independent Software Vendors: 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

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

717 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