Hello,
I am using Code Unit 400 SMTP Mail and filling the message body, but I am not sure how to create a carriage return.
Example:
I am going though the sales order lines adding the item and quantity using the appendbody function, but I want each sales order line to appear on a new line of the email.
Any ideas please?
Sorted - used html - the answer always comes after you have asked a silly question :oops:
Mr Moderator: You are welcome to delete this posting!
0
Answers
Declare 2 variables (datatype = char): CR and LF.
then do:
CR := 13;
LF := 10;
Then, with FORMAT(CR) + FORMAT(LF), you "write" a carriage return.
didn't test this, but it should work
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
I have done exactly what was stated here and it works great. The return character enters.
However I am doing this in a REPEAT UNTIL loop with two lines. The first code line adds a line to the email and the second code line adds the character return.
However after about 30 lines the character return just stops working, meaning the email that is sent has all my lines of text in 30 lines then one big paragraph at the end.
Can you share some code?
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
Whether I receive this email in Outlook itself, or outlook over the web the result is the same. If I copy and paste the whole text block into WORD or notepad the result is the same.
Basically I get a long list as expected and then suddely at a point around 30 lines down the result looks like the line:
has just stopped working, giving me a big paragraph.
"CarriageReturn" and "LineFeed" are variables with datatype "Char".
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
However as I tested it so soon after it ran normally in my scheduler there was only a few entries in the email this time. 10 to be exact. This time the problem occoured after the 2nd line. So lines 3 to 10 were all in one big paragraph.
Seems to be something to do with being near the end of the list, and nothing to do with long lists etc.
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
Weird huh?
I've been working with text quite a lot (thanks to my NavPad), but this issue ... :-k
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
D365 Business Central Solutions Architect
BC AL/NAV C/AL Developer
BC Repositories.com