Sending Mail from navision with more than one body line

KeesMeuzelaarKeesMeuzelaar Member Posts: 26
I try to send a mail from navision and i want to add a text, however this code which is a stripped version from the method used by notification management from commerce portal, places all texts after another, i cannot display
Dear Customer,
This is an Order.
It wil always do Dear CustomerThis is an Order.

Does anybody know how to create an enter.

IF ISCLEAR(OApplication) THEN
CREATE(OApplication);

IF (NOT OApplication.Logon(TRUE,'','',FALSE,FALSE)) THEN BEGIN
OApplication.Logoff;
EXIT
END;


IF ISCLEAR(OSendMail) THEN
CREATE(OSendMail);

OSendMail."To" := 'Kees.meuzelaar@wanadoo.nl';
OSendMail.BCC := 'kees@meuzelaar.com';
IF ISCLEAR(BSTRConverterBody) THEN
CREATE(BSTRConverterBody);
Body := 'TEST';
BSTRConverterBody.AppendNextStringPortion(Body);
BSTRConverterBody.AppendNextStringPortion(Body);
OSendMail.Body := BSTRConverterBody;
OSendMail.Subject := 'testmail';
IF ISCLEAR(BSTRConverterAttachFileName) THEN
CREATE(BSTRConverterAttachFileName);
AttachFileName := 'pipo.txt';
BSTRConverterAttachFileName.ResetBSTR;
BSTRConverterAttachFileName.AppendNextStringPortion(AttachFileName);
OAttachments := OSendMail.Attachments;
OAttachment := OAttachments.Add(BSTRConverterAttachFileName);
OSendMail.BodyFormat := 1;
OSendMail.OpenDialog := TRUE;
OSendMail.Send;
ErrorNo := OSendMail.ErrorStatus;
OApplication.Logoff;

Comments

  • lzrlzr Member Posts: 264
    If I remember correctly this might work:
    ch : char;
    ch := 13;
    message('line1' + ch + 'line2');
    
    Navision developer
  • krikikriki Member, Moderator Posts: 9,118
    lzr wrote:
    If I remember correctly this might work:
    ch : char;
    ch := 13;
    message('line1' + ch + 'line2');
    
    Maybe better :
    txt : text[2]
    
    txt := 'XX';
    txt[1] := 13;
    txt[2] := 10;
    message('%1','line1' + txt + 'line2');
    
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • KeesMeuzelaarKeesMeuzelaar Member Posts: 26
    BSTRConverterBody.AppendNextStringPortion(Body);
    This body has to be a text you cannot use a character.
    I already tried to use 13 in the text, the solution was to use the following code
    Char := 13
    Body := Text + FORMAT(Char) + Text
Sign In or Register to comment.