Solved

Using MAPI to force a send

Posted on 2003-10-28
6
474 Views
Last Modified: 2013-12-03
I'm sending some email directly using the MAPISendMail interface, but (under outlook at least) this just drops the mail into the outbox.  Unfortunately, our program's data is time critical, and the email needs to be forced out immediately after being sent.

Is there a MAPI call that will force the mail program to send/recieve?  If not, is there at least one specific to outlook/outlook express?

Thanks.
0
Comment
Question by:KurtVon
  • 3
  • 3
6 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 250 total points
ID: 9636414
AFAIK MAPI relies on a MAPI client like Outlook and therefore on its settings. If you want to *directly* send an EMail, why not using SMTP, e.g. http://www.codeguru.com/internet/smtp.shtml
0
 
LVL 11

Author Comment

by:KurtVon
ID: 9636562
If I have to, it's a possibility to switch.  Unfortunately we are sending multiple file attachments (the critical data) and I'm not sure how to manually encode those.

I'd also need a generalized way of finding the SMTP server the computer uses, since I don't think we can get away with asking the person installing the program to provide that information.

A definate possibility in the future, though.
0
 
LVL 86

Expert Comment

by:jkr
ID: 9637037
Hmm, all I found was that this behaviour is controlled by the profile specified when calling 'MAPILogon()' and the flags - some people claim that using MAPI_FORCE_DOWNLOAD *should* alter that behaviour.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 11

Author Comment

by:KurtVon
ID: 9637304
Nope.  It forces a download, but not an upload (at least in Outlook) unless I'm doing this wrong.  I'm logging into the current session with

    if (lpfnLogon != NULL)
    {
        LHANDLE hSession;
        nError = lpfnLogon((ULONG)m_hParent, NULL, NULL, MAPI_FORCE_DOWNLOAD, 0, &hSession);
    }

and yes, I've confirmed lpfnLogon is assigned correctly and returns 0.

And, unfortunately, like Daffy Duck, I can only perform this trick once: http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/q130/7/03.asp&NoWebContent=1
0
 
LVL 11

Author Comment

by:KurtVon
ID: 9642315
Well, given how far these questions move down in a day, it's unlikely anyone is going to have a better suggestion, and SMTP will do pretty much what we need.  I found some examples of how to attach files, so I think I can wing it.

Thanks for the help.
0
 
LVL 86

Expert Comment

by:jkr
ID: 9642337
Thank you!
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

This article describes a technique for converting RTF (Rich Text Format) data to HTML and provides C++ source that does it all in just a few lines of code. Although RTF is coming to be considered a "legacy" format, it is still in common use... po…
With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

762 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now