Solved

Newline in mail

Posted on 2004-08-18
4
486 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

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

Suggested Solutions

Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …

680 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