I have a function that create emails and in the function I call the function AddBodyLine in codeunit 397 (Mail). I pass a textline, CR and LF.
In NAV 2009 it works perfectly, but in NAV 2013 the CR LF is ignored and I get a mailbody with one very long line.
If I use the function AppendBody in codeunit 400 (SMTP Mail) it works perfectly in both NAV 2009 and NAV 2013.
Can anyone tell me how to pass the CR LF to codeunit 397 in NAV 2013?
Name DataType Subtype Length
SMTPMail Codeunit SMTP Mail
Mail Codeunit Mail
MailClient Option
CR Char
LF Char
CRLF Text 2
CR := 13;
LF := 10;
CRLF := FORMAT(CR) + FORMAT(LF);
...
IF MailClient = MailClient::SMTP THEN
SMTPMail.AppendBody(Text + CRLF)
ELSE
Mail.AddBodyline(Text + CRLF);
Comments
BR would give you a line break.
BSTRConverterBody.AppendNextStringPortion(TextLine);
have no idea how it works, but apparently it is something what messing with your CRLF
MailCD.AddBodyline('Text1');
MailCD.AddBodyline(FORMAT('<br>'));
MailCD.AddBodyline('Text2');
MailCD.AddBodyline(FORMAT('<br>'));
MailCD.AddBodyline('Text3');
MailCD.AddBodyline(FORMAT('<br>'));
MailCD.AddBodyline('Text4');
works like a charm with HTML format TRUE.
I think rest of the HTML tags can also be used like this.
I'm curious Torben if and how you solved the problem?
Gonna try the suggestions with BR now.
Tino Ruijs
Microsoft Dynamics NAV specialist
Double checked my code; I only use Char = 10 as LineBreak character.
Thank you very much! Got it working again. =D>
Tino Ruijs
Microsoft Dynamics NAV specialist