Solved

Using MAPI to force a send

Posted on 2003-10-28
6
499 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 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
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

 
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

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

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

Suggested Solutions

This article describes how to programmatically preset the "Pages per Sheet" option that's available with most printer drivers.   This setting lets you do "n-Up" printing, where two, four, or more pages are printed on each sheet of paper. If your …
As more and more people are shifting to the latest .Net frameworks, the windows presentation framework is gaining importance by the day. Many people are now turning to WPF controls to provide a rich user experience. I have been using WPF controls fo…
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…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

737 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