Outlook integration error

anupanup Member Posts: 19
hi all,

I am running a simple test codeunit which mails report o/p (.html file) as an attachment.

After running the codeunit, Navision gets closed.
can somebody tell me what's the problem with following codeunit ??

Anuradha


CLEAR(Mail);
IF REPORT.SAVEASHTML(5060, 'D:/Anuradha/Test report', FALSE) THEN BEGIN
MESSAGE('Successfully saved');
IF NOT Mail.NewMessage('e-mail address','','Test report','',
'D:/Anuradha/Test Report',TRUE) THEN
ERROR('Mail not sent');
END ELSE
MESSAGE('Not saved');

Comments

  • Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    What message do you get?

    When I run the codeunit I have to replace the 'D:/Anuradha/Test report' for 'C:\test.html'

    Then after changing the emailadres for a valid address it works like a charm
  • anupanup Member Posts: 19
    I get following error -

    "Microsoft Business Solution Navision has encountered an error and needs to be closed"

    getting same error for following code -


    CLEAR(Mail);
    REPORT.SAVEASHTML(5060, 'C:\test.html');

    ToName := 'valid e-mail address';
    CCName := '';
    Subject := 'Test report';
    Body := 'Test report';
    AttachFileName := 'C:\test.html';
    OpenDialog := TRUE;

    Mail.NewMessage(ToName,CCName,Subject,Body,
    AttachFileName,OpenDialog);
  • Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    Does it happen on all computers or on just one? It looks like something is wrong with the installation of either navision or outlook.
  • anupanup Member Posts: 19
    that i have to check out.... i also get error while running ' synchronize with outlook ' function, saying wrong profile name.....

    will get back after checking on another computer.

    Thanks.
  • anupanup Member Posts: 19
    it's working on other PC, so problem is with my outlook..
    but i have to manually press send, mail is not going automatically...

    by the way which outlook/express version is most suitable for 4.0 ??

    Anuradha
  • gavrishanchorgavrishanchor Member Posts: 10
    To post automatically assign false to OpenDialog.
Sign In or Register to comment.