Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Delphi and Outlook - adding line feeds to the body text

Posted on 2010-09-05
4
Medium Priority
?
409 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 500 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

730 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