Solved

Newline in mail

Posted on 2004-08-18
4
477 Views
Last Modified: 2010-08-05
Hello,

My application send an mail like this :

 > mailBody := 'mailto:' +operateur.mailadress + '?subject=refus&body=Line1' + #10#13 + 'Line2' ;
 > shellexecute(self.Handle,'open', pansichar( mailBody)  ,nil,nil,0);

But in my message 'Line 1' and 'Line2' are in the same line.

How can do to have 'Line2' under 'Line1' in my body ?

Thanks

Sang-Do
0
Comment
Question by:PHD
  • 3
4 Comments
 
LVL 3

Accepted Solution

by:
Tyrsis earned 500 total points
ID: 11828560
Hi there.

Hmm, I'm assuming this is in Delphi?  

Add HttpApp to your uses clause.  You need to encoude the #13#10 characters.  Do the following:

var
    szMailBody : String;
begin
    szMailBody := 'mailto:me@myplace.com?subject=refus&body=' + HttpEncode('Line1' + #13#10 + 'Line2');
    ShellExecute(self.Handle, 'open', PAnsiChar(szMailBody), nil, nil, 0);
end;

Hope this helps!

Tyrsis
0
 
LVL 3

Expert Comment

by:Tyrsis
ID: 11828564
Uhm, oops, I put my email address in there by mistake.  doh.  Remove that obviously.
0
 
LVL 6

Author Comment

by:PHD
ID: 11828605
It is in Delphi. Your solution workfine.

doh stands for ??
0
 
LVL 3

Expert Comment

by:Tyrsis
ID: 11828627
Doh = oops.  From the TV show Simpsons.  Nevermind :)
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
maxMirror challenge 10 89
wordsWithoutList  challenge 24 77
python sqlite question 11 43
Turning python script into an applet 12 46
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
A short article about a problem I had getting the GPS LocationListener working.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

743 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

15 Experts available now in Live!

Get 1:1 Help Now