Options

Navision Application Server & MSMapi problem

kujukuju Member, Microsoft Employee Posts: 62
edited 2002-12-27 in Navision Attain
Hi,

I do have a problem with nas & msmapi.

When i run a codeunit in foreground from a navision client which has to send an email using msmapi the email is being succesful send.

When i run this same codeunit in a nas with the same (Windows)user on the same machine the mail is not send.

Here is my code :
MAPISession.DownLoadMail := FALSE; 
IF MAPISession.SessionID = 0 THEN BEGIN 
  IF NOT GUIALLOWED THEN BEGIN 
    IF "E-Mail Profile Name" = '' THEN BEGIN 
      recKTNNASApplication.RESET; 
      recKTNNASApplication.SETCURRENTKEYCode,Application,Company); 
      recKTNNASApplication.SETRANGE(Code,'BACKGROUND'); 
      recKTNNASApplication.SETRANGE(Application,'KTN'); 
      recKTNNASApplication.SETRANGE(Company,COMPANYNAME); 
      IF recKTNNASApplication.FIND('-') THEN 
       "E-Mail Profile Name" := recKTNNASApplication."E-Mail profile name"; 
    END; 
    MAPISession.UserName := "E-Mail Profile Name"; 
    MAPISession.LogonUI := FALSE; 
  END; 
  MAPISession.SignOn; 
END;

MAPIMessages.SessionID := MAPISession.SessionID; 
MAPIMessages.Compose; 
fct_SetNames(1,ToName); 
MESSAGE('set names'); 
fct_SetNames(2,CCName); 
MESSAGE('set names2'); 
MAPIMessages.MsgSubject := Subject; 
MESSAGE('set subject'); 
NoOfAttachments := 0; 
WHILE AttachFileName[NoOfAttachments + 1] <> '' DO 
NoOfAttachments := NoOfAttachments + 1;

IF NoOfAttachments = 0 THEN BEGIN 
  MAPIMessages.MsgNoteText := Body; 
  MESSAGE('body'); 
END ELSE BEGIN 
  MESSAGE('%1',NoOfAttachments); 
  MESSAGE('%1',AttachFileName[1]); 
  MAPIMessages.MsgNoteText := Body + PADSTR('',NoOfAttachments); // reserve positions for multiple attachments 
  FOR i := 1 TO NoOfAttachments DO BEGIN 
    MAPIMessages.AttachmentIndex := i - 1; 
    MAPIMessages.AttachmentType := 0; 
    MAPIMessages.AttachmentPathName := AttachFileName[i]; 
    MAPIMessages.AttachmentPosition(STRLEN(Body) + i - 1); 
  END; 
END;

MESSAGE('before sending'); 
MAPIMessages.Action(3); // Send or //MAPIMessages.Send; 
MESSAGE('after sending');



When i go and look in the event log the last message is "before sending" and the nas is hanging and doing nothing ....

First i assumed it has something to do with profiles but i checked this. I also tryed this with the outlook app open and closed!

Anyone ????
Dynamics Rules!

Comments

  • Options
    Jens_MadsenJens_Madsen Member Posts: 23
    Have you installed Outlook 2000 ???

    The components used for mail in NAS seem to need an extended mapi that ships with outlook 2000.

    Of course (?) this is if you're using windows 2000, on Windows NT 4 the extended mapi comes with standard installation :)
Sign In or Register to comment.