Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Using MAPI to force a send

Posted on 2003-10-28
6
Medium Priority
?
524 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
Learn Veeam advantages over legacy backup

Every day, more and more legacy backup customers switch to Veeam. Technologies designed for the client-server era cannot restore any IT service running in the hybrid cloud within seconds. Learn top Veeam advantages over legacy backup and get Veeam for the price of your renewal

 
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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

If you have ever found yourself doing a repetitive action with the mouse and keyboard, and if you have even a little programming experience, there is a good chance that you can use a text editor to whip together a sort of macro to automate the proce…
In this article, I will show how to use the Ribbon IDs Tool Window to assign the built-in Office icons to a ribbon button.  This tool will help us to find the OfficeImageId that corresponds to our desired built-in Office icon. The tool is part of…
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…

610 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