Solved

Delphi and Outlook - adding line feeds to the body text

Posted on 2010-09-05
4
397 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Using idhttp to login to instagram 2 118
FMX and jaudiotracker playing memory stream 29 97
Delphi problems to abort a printjob 9 34
Delphi android app hide keyboard 3 40
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

713 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