JvMail & Outlook Express

Posted on 2009-02-14
Last Modified: 2012-05-06
XP Pro III + D2007

I also used RapWare, same problem.

I create a PDF File, which I attach.

After JvMail1.SendMail a couple of problems manifest themselves:

1) On closing the OE New Message Screen, my App disappears into the Background
2) When I delete the Tempfile with Assignfile(F); erase(F); it takes a very long time to execute

I have tried with Application.BringToFront which works, but produces a lot of Flickering and with anything other than OE, for instance Thunderbird, Thunderbird disappears into the Background.

BringWindowToTop(Handle)  doesn't always keep the App on Top.

I have also tried to run the SendMail procedure in a separate Thread, but also to no avail.

The OE Interface appears to be system modal, while Thunderbird doesn't.

I think, if there were a way to run OE Non-Modal, I could cater for both, but I don't seem to find anything anywhere.

Kind Regards
Question by:WRieder

    Author Comment

    After some googling I found, that a problem with some versions of OE was that after calling a mapi send function the calling window became non-modal and disappeard  into the background. The following solution was recommended:

    EnableWindow(Application.MainForm.Handle, False);

    This seems to also prevent the App from disappearing into the Background.

    I should maybe more clearly define my question, which actually is comprised of two parts:

    1) Is it possible to make the NewMessage Popup of OE Non-Modal to prevent this annoying flickering?

    2) What could cause the deletion of a File using "AssignFile(F); Erase(F)" to be so slow? The computer almost seems to "hang" for up to 25 Secs. (This is not consistent behaviour though, sometimes there is absolutely no delay)

    If this is too complex for the points assigned, please indicate what you would like for a solution.

    Kind Regards

    Accepted Solution

    I just found the solution. In JvMail I definded a public Variable like so:

    CallingWindow: HWND;

    In the calling Window:

    JvMail1.CallingHandle := Self.Handle;

    and then changed the TJvMail.SendMail procedure to use CallingHandle instead of Application.Handle
    like so:

    procedure TJvMail.SendMail(ShowDialog: Boolean);
      Flags: ULONG;
        Flags := LogonFlags;
        if ShowDialog then
          Flags := Flags or MAPI_DIALOG;
          ErrorCheck(FSimpleMapi.MapiSendMail(FSessionHandle, CallingHandle,
            FMapiMessage, Flags, 0));

    Maybe someone might find this useful.

    Kind Regards

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
    Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    779 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

    16 Experts available now in Live!

    Get 1:1 Help Now