Codeunit 397: Mail - AddBodyLine
Torben_R.
Member Posts: 99
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?
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);
0
Comments
-
you could use a html email body. something like <P> your text here <BR> another line </P>
BR would give you a line break.0 -
Actually, I might be misguided you. In codeunit 357 there is weird BSTR converter
BSTRConverterBody.AppendNextStringPortion(TextLine);
have no idea how it works, but apparently it is something what messing with your CRLF0 -
maybe this one old post will help you: http://www.mibuso.com/forum/viewtopic.php?t=54960
-
I did it this way:
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.0 -
Experiencing the same problem in NAV 2013 R2 latest build 36281.
I'm curious Torben if and how you solved the problem?
Gonna try the suggestions with BR now.
Tino Ruijs
Microsoft Dynamics NAV specialist0 -
I faced the same problem a while ago, see this topic.
Double checked my code; I only use Char = 10 as LineBreak character.0 -
Shedman wrote:I faced the same problem a while ago, see this topic.
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 specialist0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 610 NAV Courses, Exams & Certification
- 1.9K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 250 Dynamics CRM
- 102 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions
