Delphi and Outlook - adding line feeds to the body text

I've written a program that interacts with Outlook but I'm having trouble getting linefeeds into the body of the text.  The 2 pertinent lines of the program are:
mail:= 'mailto:'+gmail+'?subject=' +sub + '&body='+body+'&cc='+gmailcc;

and
ShellExecute(Handle,'open',PChar(mail),nil,nil,SW_SHOWNORMAL);

where :
gmail, gmailcc are addresses
sub is just some text
body is the message of the email

My question is how to put linefeeds in this message
s_w_e2Asked:
Who is Participating?
 
bjoveCommented:
Use '%0D%0A' as newline string.

body := 'Line1'+'%0D%0A'+'Line2';

Open in new window

0
 
Emmanuel PASQUIERFreelance Project ManagerCommented:
you can insert '%0A' in your body string where you want a line return

This will convert all 'normal' ret line codes with it
body:=StringReplace(body,#13#10,'%0A',[rfReplaceAll]);

Open in new window

0
 
s_w_e2Author Commented:
Thank you
0
 
Emmanuel PASQUIERFreelance Project ManagerCommented:
Have I not said the same thing ???
Plus the way to automatically replace ascii ret line with the sequence in your entire body string ?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.