Mail

sabzamsabzam Member Posts: 1,149
Hi eVERYBOYD,

I am customising the mail codeunit. I need to have display a number of lines instead of just one line. Is this possible? At the moment everything is being displayed as just one line. FOR EXAMPLE:

xxxxxxxxxx : xxxxxxxxx

But I need them to be written as
xxxxxxxxxx
xxxxxxxxxx

Is it possible?

Comments

  • garakgarak Member Posts: 3,263
    chr <- variable of type char
    Body <- Variable of Type Text 260
    Mail variable of thype codeunit Mail
    
    chr := 13;
    Body := 'This' + format(chr) + 'is' + format(chr) + 'a' + format(chr) + 'Test' + format(chr);
    Mail.NewMessage('Mail@Mail.com','','tedstr',Body,'',true);
    

    It's an fast example. If you search the forum, i'm sure, u will find a lot of examples

    Regards
    Do you make it right, it works too!
  • willywilly Member Posts: 67
    //Mail is a variable of type Codeunit 397
    //LF is a variable of type Text length 2

    LF := ' ';
    LF[1] := 10;
    LF[2] := 13;


    Mail.AddBodyline('this is line 1');
    Mail.AddBodyline(LF) ;
    Mail.AddBodyline('this is line 2');
    Mail.AddBodyline(LF) ;
    Mail.AddBodyline('this is line 3');

    Mail.NewMessage(ToName,CCName,Subject,Body,AttachFileName,OpenDialog)
  • sabzamsabzam Member Posts: 1,149
    Hi this has worked perfectly.....thanks alot.

    Last question. What should I do to skip a line for example

    xxxxxxxxxxxxxxxx
    xxxxxxxxxxxxxxxx

    xxxxxxxxxxxxxxx
  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    Did you try:
    Mail.AddBodyline('this is line 1'); 
    Mail.AddBodyline(LF) ; 
    Mail.AddBodyline('this is line 2'); 
    Mail.AddBodyline(LF) ; 
    Mail.AddBodyline(LF) ; 
    Mail.AddBodyline('this is line 3');
    
    ?
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • sabzamsabzam Member Posts: 1,149
    Yeppp, I have just managed. Thought I needed different numbering for a new line.

    Thanks alot to everybody!!!
Sign In or Register to comment.