Newsgroups : Borland : borland.public.delphi.internet.winsock : 2007 Oct : Re: Adding Linefeeds, suggestions please?
| Subject: | Re: Adding Linefeeds, suggestions please? |
| Posted by: | "Remy Lebeau (TeamB)" (no.spam@no.spam.com) |
| Date: | Thu, 18 Oct 2007 15:04:34 |
<orangecat@cableone.net> wrote in message
news:q6hfh3hrvlmosn5m0d4vfkmgikbvrq726m@4ax.com...
> pmPending.Lines.Add('Line 1:'+myCrLf);
> pmPending.Lines.Add('Line 2:'+myCrLf);
> pmPending.Lines.Add('Line 3:'+myCrLf);
Add already includes its onw CRLF. You don't need to provide your own:
pmPending.Lines.Add('Line 1:');
pmPending.Lines.Add('Line 2:');
pmPending.Lines.Add('Line 3:');
> stEmail:='mailto:gary@cableone.net'+
> '?Subject=Purchase Request'+
> '&Body='+pmPending.Lines.Text;
You can't include line breaks in the Body parameter. You will have to
encode them first (and any other illegal characters), ie:
stBody := StringReplace(pmPending.Lines.Text, #13#10, '%0D%0A',
[rfReplaceAll]);
stBody := StringReplace(stBody, ' ', '%20', [rfReplaceAll]);
// encode other illegal characters as needed...
stEmail:='mailto:gary@cableone.net' +
'?Subject=Purchase%20Request' +
'&Body=' + stBody;
With that said, not all email programs allow you to use multiple parameters
like that to begin with, or even support the mailto protocol at all. You
should use SimpleMapi/MAPI or SMTP instead.
Gambit