Solved

Newline in mail

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

I know it’s not a new topic to discuss and it has lots of online contents already available over the net. But Then I thought it would be useful to this site’s visitors and can have online repository on vim most commonly used commands. This post h…
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.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

828 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