Link to home
Start Free TrialLog in
Avatar of s_w_e2
s_w_e2

asked on

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
Avatar of Emmanuel PASQUIER
Emmanuel PASQUIER
Flag of France image

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

ASKER CERTIFIED SOLUTION
Avatar of bjove
bjove
Flag of North Macedonia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of s_w_e2
s_w_e2

ASKER

Thank you
Have I not said the same thing ???
Plus the way to automatically replace ascii ret line with the sequence in your entire body string ?