Sending mail via SMTP Server
Tatevik
Member Posts: 28
Hello All!!! I need help with following issue :? :? :?
I used to send mail via SMTP server by using Dynamics NAV 5.0 SP1 standard 400 codeunit.
I need to add several lines to the body.
When I wrote the following part of th code in the loop it didn't return carriage return and all information was shown on the one line.
SMTPMail.AppendBody(Body +FORMAT(chCR) + FORMAT(chLF));
Then I change code and instead of FORMAT(chCR) + FORMAT(chLF)
I used <p> or <br> (HTML tags).
somthing like this:
SMTPMail.AppendBody(Body +'<p>')
by these way everything was fine each feild was typed from new line.
Any suggestion. why 'FORMAT(chCR) + FORMAT(chLF)' does not work?
I used to send mail via SMTP server by using Dynamics NAV 5.0 SP1 standard 400 codeunit.
I need to add several lines to the body.
When I wrote the following part of th code in the loop it didn't return carriage return and all information was shown on the one line.
SMTPMail.AppendBody(Body +FORMAT(chCR) + FORMAT(chLF));
Then I change code and instead of FORMAT(chCR) + FORMAT(chLF)
I used <p> or <br> (HTML tags).
somthing like this:
SMTPMail.AppendBody(Body +'<p>')
by these way everything was fine each feild was typed from new line.
Any suggestion. why 'FORMAT(chCR) + FORMAT(chLF)' does not work?
0
Comments
-
If mail is send using HTML, then CR/LF do not work.
If for example you write:
in the body of a HTML-formatted mail, it will appear asLine 1
Line 2
If the mail is send as text, then CR/LF will work as intended.Line1Line2
In codeunit 400, the parameter HtmlFormatted in function CreateMessage is used to determine if the mail is send out as HTML or as text.No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)0 -
Hi Tatevik,
I created a text variable CRLF and set CRLF[1] := 13; and CRLF[2] := 10;
When I add at the end of my SMTP.AppendBody('<Your Text>' + CRLF + CRLF ) I'm getting an additional line after my text.
I hope this helps.
...Manfred0 -
Thank You Luc...
It helped me so much.
Thanks Again,
Mallikarjuna0
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
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 253 Dynamics CRM
- 103 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
