Solved

Newline in mail

Posted on 2004-08-18
4
490 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
[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
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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.
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
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…

740 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