I have a small problem with regards to sending mails from NF. Trouble is that if Outlook isn’t up and running the mails will be delivered to the Outbox but will not be sent until Outlook is started. Do I have to have Outlook running at all time ? or is there a way to open Outlook, send the message and then close Outlook again ? Thanks in advance for any and all replies.
Sunset, I’ve created and modified my own version of codeunit 397 - Mail. Navision mails via the outlook ocx and this works even if outlook is not open. This has worked for Outlook97 & 2000. Variable : MAPIMessages DataType : OCX SubType : Microsoft MAPI Messages Control, version 5.0 Variable : MAPISession DataType : OCX SubType : Microsoft MAPI Session Control, version 5.0 The code to actually send the email; MAPIMessages.Action(3); // Send Hope this helps
I’m running Outlook 2000, and haven’t tested it with express as the customer is using 2000. The furthest I can get the mail with Outlook shut down is to the outbox (using action(3) ) but the message won’t be sent until I open Outlook. Since you are able to get it sent without opening outlook I’m gussing that perhaps it is a setting in Outlook that I’m missing, but the only thing I can find is the send immidiatly, but that doesn’t make the difference. Further help appreciated. Svend Heinesen Programmer Vision Software Faroe Islands
Svend, Have you looked at the codeunit 397 - Mail? That sends an email if outlook is not open. The following lines may be the key; IF MAPISession.SessionID = 0 THEN MAPISession.SignOn; MAPIMessages.SessionID := MAPISession.SessionID; Hope this helps.
What patches have you installed for Outlook 2000. I believe that the SR2 patch has shutdown this ability in outlook due to the increase in Virus’ that propagate through the e-mail. Bill McCorkle
Bill, I am using Outlook 2000 with service pack 2 installed. The only difference sp2 makes, is that as you try to send the email via the ocx control, it displays 2 message windows with Yes No buttons. If you click on the Yes button for both windows, it will proceed to send the email.
Not Service Pack 2, Service Release 2. You would have to download and install it on your own, Microsoft update will not add this one. Bill McCorkle
Bill, I didn’t realise there was a difference? I always thought that service releases were original versions with service packs installed. If they are different, then I cannot vouch for service release 2. P.S. We have users running OfficeXP and it works for them.
I’ve tried debugging CU 397, and I’m signing on whether or not I have Outlook running, and no matter how many times I send it. Not sure what to make of it, as I have no experience programming with Outlook (Microsoft) Although I haven’t personally installed any releases nor patches, this might be the problem. All I can see is version nr. (5.0.2195 build 2195) don’t know whether 2195 indicates patch/release 2. Guess I’ll have to find an old(er) version to try it on. Thanks for responses and help. Svend Heinesen Programmer Vision Software Faroe Islands Edited by - Sunset on 2001 Oct 04 12:23:43
Solution:
MAPISession.DownLoadMail := True;
With best regards from Switzerland Marcus Fabian
Have been able to establish that it is Outlook 2000 that is the problem ! Running with Outlook Express works like a charm. Unfutunately DownLoadMail doesn’t work either, but at least I’m closer to a solution now that the problem has been narrowed down One thing that might speed up a solution would be MAPI96.HLP; which is the help file the OCX is referring to. The only reference to it I can find elsewhere is “Visual Basic”. So if anybody know where I could get hold of just the help-file as it seems a bit over the top to purchase the whole program. Don’t know if this might however be a copyright violation Svend Heinesen Programmer Vision Software Faroe Islands