Click to See Complete Forum and Search --> : How to store a message in Outbox using Simple MAPI?


April 26th, 1999, 01:55 PM
Hello everybody. I have been asked to write an app which is capable of
sending and receiving e-mail messages in the background, without giving any
idea to the user. Ideally, it should place the outgoing messages in the
Outbox. When the Outbox is flushed, it should send the messages in the Outbox
without giving any visual feedback to the user (similar to OL and OE).

I am using Outlook Express as my Simple MAPI client.

My program does send messages out using MAPISendMail, but the messages never
stay in the Outbox. MAPI immediately connects to the ISP's POP3 and SMTP servers, sends the
messages out, and downloads all new messages. While doing so, it displays a status dialog box, showing the
progress of the operation.

If, instead of using my program, I use the MAPI Client sample program (the one
that comes with MSDN), the program places the message in the outbox, and tells
you so by displaying a dialog box... "When you send an e-mail message, it will
be placed in your Outbox folder ready to be sent the next time you choose the
'Send and Receive' command"

Any idea as to what's going on, and how can I achieve what I am trying to
achieve? PLEASE TREAT THIS AS URGENT... I HAVE A DEMO COMING THURSDAY.

Thanks a lot,
Kamran

Steve Dwire
April 27th, 1999, 08:27 AM
You say you "have been asked to write an app which is capable of sending and receiving e-mail messages in the background, without giving any idea to the user." I would not recommend trying to take advantage of whatever e-mail client the user may have installed. There's no telling what kind of feedback it might try to give. We have a program that we use in-house that sends e-mail automatically, even if the user doesn't have an e-mail account. We ended up using CSocket and following the RFC for SMTP to send the mail as if we were an e-mail client ourselves. It seems to work quite well unless you want the user to have a copy of every message they send in their "Sent Items" box. Then you would have to use their e-mail client, and I'm not sure how you'd go about it then.