Solved

Delphi and Outlook - adding line feeds to the body text

Posted on 2010-09-05
4
391 Views
Last Modified: 2012-05-10
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
0
Comment
Question by:s_w_e2
  • 2
4 Comments
 
LVL 25

Expert Comment

by:epasquier
ID: 33608780
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
 
LVL 4

Accepted Solution

by:
bjove earned 125 total points
ID: 33608845
Use '%0D%0A' as newline string.

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

Open in new window

0
 

Author Closing Comment

by:s_w_e2
ID: 33608882
Thank you
0
 
LVL 25

Expert Comment

by:epasquier
ID: 33608901
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

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now