Advertisements

Multiple Line Mail Body Formatting without using Mail Templates

I came across one requirement from one of my customer, so I decided to share the solution with you all.

In today’s post we will see how we can create multi line mail body for SMTP mail.

Lets start with the solution rather than talking of logic.

Step-1: Create a codeunit for the function or decide where you wish to add this function

Step-2: Define Variables

1

you may notice that Variable CRLF is defined as Text with Size 2.

Define all other variables that you may require as per your logic.

Step-3: Write the function. Define your parameters and additional codes you may require as per your logic.

2

In above code notice that I have set last parameter of CreateMessage as FALSE for(HTMLFormatted), this is required else CRLF logic will not work.

Where ever I require New Line I just add CRLF.

3

Step-4: SMTP Mail Setup I am using as below for live.com, you check with yours SMTP details accordingly.

4

Yes we are done now you can execute the above function to generate your mails.

I will come up with more details in my upcoming posts, till then keep exploring and learning.

 

 

 

Advertisements

Comments are closed.

Important

Most of the contents you find in this blog will be either inherited from MSDN or Navision Developer IT Pro Help. Some places images are also directly taken from these sites. Purpose is simple to try those stuffs and re-produce adding few things as per my understanding to make easy understanding for others and quick reference.

Here nothing under my own brand or authorship of the content. At any point of time we are just promoting Microsoft stuffs nothing personnel with same.

Hope stuffs used here will not violate any copyright agreement with them. In case by mistake or in-intestinally it happens and the Microsoft feels these should not be used Microsoft have full right to inform me about same and will be glad to take down any such content which may be violating the norms.

Purpose is to promote Navision and share with community.

FB Profile

Like FB Page

%d bloggers like this: