?
Solved

How can I send a mail modelessly?

Posted on 1998-09-23
14
Medium Priority
?
319 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
Get proactive database performance tuning online

At Percona’s web store you can order full Percona Database Performance Audit in minutes. Find out the health of your database, and how to improve it. Pay online with a credit card. Improve your database performance now!

 

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

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

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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.
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses
Course of the Month10 days, 21 hours left to enroll

770 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