mail with attachment

ChilangoChilango Member Posts: 5
edited 2005-02-22 in NAV Tips & Tricks
Hi,

I would like to send e-mails with more than one attach. So I had
modified the codeunit mail (397). When I do not use text I could
not order the attachments and when I am trying to modifiy the
function I get errors in the mailing system.

//-002
IF DateiNameAnhängen2 <> '' THEN BEGIN
MAPIMitteilungen.AttachmentIndex := MAPIMitteilungen.AttachmentCount;
MAPIMitteilungen.AttachmentType := 0;
MAPIMitteilungen.AttachmentPathName := DateiNameAnhängen2;
// MAPIMitteilungen.AttachmentPosition();
END;
//+002

Thank you very much
for helping

Comments

  • mfabianmfabian Member Posts: 187
    This forum is for placing Tips&Tricks only, not for support. You might be more successful to ask your question in the Navision Developer section of this Forum and read the many postings which have already been written about MAPI issues.

    Marcus
    With best regards from Switzerland

    Marcus Fabian
  • naushienaushie Member Posts: 33
    hi mate you can use this code


    NewMessage(ToName : Text[80];Subject : Text[250];Body : Text[250];AttachFileName1 : Text[250];AttachFileName2 : Text[250])


    MAPISession.DownLoadMail := FALSE;
    IF MAPISession.SessionID = 0 THEN BEGIN
    IF "E-Mail Profile Name" <> '' THEN BEGIN
    MAPISession.UserName := GetProfileName();
    MAPISession.LogonUI := FALSE;
    END;
    MAPISession.SignOn;
    END;
    MAPIMessages.SessionID := MAPISession.SessionID;
    MAPIMessages.Compose;
    SetNames(1,ToName);
    MAPIMessages.MsgSubject := Subject;
    IF AttachFileName1 = '' THEN
    MAPIMessages.MsgNoteText := Body
    ELSE BEGIN
    MAPIMessages.MsgNoteText := Body + ' ';
    MAPIMessages.AttachmentIndex := MAPIMessages.AttachmentCount;
    MAPIMessages.AttachmentType := 0;
    MAPIMessages.AttachmentPathName := AttachFileName1;
    IF AttachFileName2 <>'' THEN BEGIN
    MAPIMessages.AttachmentIndex :=MAPIMessages.AttachmentIndex +1;
    MAPIMessages.AttachmentPathName := AttachFileName2;
    END;
    MAPIMessages.AttachmentPosition(STRLEN(Body));
    END;
    MAPIMessages.Action(3);
    Naushad Alam
    Consultant -Navision

    All e Technologies (P) Ltd.
    Building Solutions for Extended Enterprises

    www.alletec.com
Sign In or Register to comment.