How to format text in Mail

Hi,

I want to inlude new line in the body of my mail message.How should i do.

Hi Bavani,

Please remember to add a bit more information when you ask a question. As a minimum you should always write what version you’re having a problem with and exactly what you’re trying to do.

The answer to your question could be:

  1. Hit enter to insert a new line (if you’re using the function SEND-TO)

  2. If you’re programming and using Codeunit 397 (Mail), then you can use the function AddBodyline

  3. Or if you’re using codeunit 400 (SMTP Mail), then function AppendBody.

Im using version 5.0 and codeunit Mail.

Whenever i click on a button a mail should go to all Email ids in the list form.

Im using

Mail.NewMessage function.

Whatever i give into the body variable its coming in a single line.I tried using ‘+’ and enter ,but its coming in a single line only.

For example i want to send a mail like this

Dear Bavani,

COngratulations! You are appointed.

Regards

Uma

Something of this sort.

How should i proceed to get in this format.

I have written the code like this

FIND(’-’) ;
REPEAT
body := ‘Dear’+Name+‘Congratulatios you got selected’;
mail.NewMessage(“Email Id”,’’,‘hi’,body,’’,FALSE);
UNTIL NEXT=0;

Then this applies:

  1. If you’re programming and using Codeunit 397 (Mail), then you can use the function AddBodyline

Just use this function to add addition body lines.

I understand that Addbodyline ll be used to insert new lines.But will i be able to use newmessage function.How will i pass the body parameter in the NewMessage function if im using AddBodyLine

You can’t do that. You need to create that “manually”. The NewMessage is only for “simple” emails.

Can you suggest how to do for my requirements…

Well personally I would not use the codeunit 397. Instead I would use codeunit 400 (SMTP Mail), it’s much easier to work with and doesn’t require that your user have a MAPI profil on the PC. But then again the SMTP as other disadvantages.