gpt4 book ai didi

delphi - ShellExecute邮件的正文字符

转载 作者:行者123 更新时间:2023-12-03 18:37:58 25 4
gpt4 key购买 nike

我想使用ShellExecute,以便用户可以从他的默认电子邮件程序发送电子邮件;例如

const
CRLF = '%0D%0A';
var
Body: string;
begin
Body := 'Information from my program'+CRLF+
'that is put in the body of the email';
ShellExecute(Application.Handle, 'open', PChar('?Subject=My Subject&Body=' +
Body),nil, nil, SW_SHOWNORMAL);


我想用信息列格式化正文。如何放置空白?似乎%20可以在单个空格中工​​作-有时,但是在一行的开头或几个连续的空格中不起作用。这''也不起作用:(

最佳答案

在字符串中使用双引号(Chr(34)):

Body :=  #34 + 'Information from my program' + CRLF +
'that is put in the body of the email' + #34;
ShellExecute(Application.Handle, 'open',
PChar('?Subject=My Subject&Body=' + Body), nil, nil, SW_SHOWNORMAL);


要排成一列,可以尝试使用制表符代替( Chr(9))-正如我在评论中所说,在Windows 7的Thunderbird上,我无法让 ShellExecutemailto一起使用:

Body :=  #34 + 'Information from my program' + CRLF +
'that is put in the body of the email' + CRLF +
'Col1'#9'Col2'#9'Col3' + #34;


(使用 Stuff#9“更多内容”进行嵌入是 'Stuff' + #9 + 'More Stuff',顺便说一句。

关于delphi - ShellExecute邮件的正文字符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10907081/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com