?
Solved

Using MAPI to force a send

Posted on 2003-10-28
6
Medium Priority
?
513 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
[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
  • 3
  • 3
6 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 1000 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
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

This article shows how to make a Windows 7 gadget that accepts files dropped from the Windows Explorer.  It also illustrates how to give your gadget a non-rectangular shape and how to add some nifty visual effects to text displayed in a your gadget.…
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…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

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