发送带签名的电子邮件 [英] Sending Email with signature

查看:116
本文介绍了发送带签名的电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用:

        ShellExecute(Self.Handle,
            nil, PCHAR(format('mailto:%s ?Subject=Assunto: &Body=',[_lEmails ])),
            nil,
            nil,
            SW_NORMAL);

发送电子邮件。
没有正文文本,因此在电子邮件客户端中具有自动签名的用户会自动获得这些签名。

to send emails. No Body text so the users that have automatic signatures in their emails clients get those automatically.

现在,我想使用户也可以插入文本,但是如果他们这样做,则文本到达那里但没有签名。
是否可以强制执行此操作。

Now I want to enable users to insert text as well, but if they do the text gets there but no signature. Is there a way to "force" this.

谢谢

推荐答案

您可以使用 MAPI 消息应用程序编程接口),它可以使您更好地控制电子邮件,并允许附件之类的东西。您还可以选择是显示用户的电子邮件客户端撰写窗口还是直接添加到发件箱。 (由于Windows安全性的变化,现在通常限制了发件箱功能,尤其是在涉及MS Outlook的情况下。)

You can use MAPI instead (the Messaging Applications Programming Interface), which gives you much better control over the email, and allows things like attachments. You can also choose whether to show the user's email client "compose" window or add directly to the outbox. (The outbox functionality is usually restricted now because of changes to Windows security, especially where MS Outlook is concerned.)

最快,最简单的方法是使用< a href = http://wiki.delphi-jedi.org/index.php?title=JEDI_Code_Library rel = nofollow> JEDI代码库 JCLEMail 。它是SimpleMAPI的包装,使它非常容易(代码是从较旧的应用程序获取的,并且基于JCL演示的示例):

The quickest, easiest way is to use something like the JEDI Code Library JCLEMail. It's a wrapper around SimpleMAPI, which makes it very easy (code was taken from an older app, and was based on a sample from the JCL demo):

EMail := TJclEMail.Create;
try
  EMail.Recipients.Add(AnsiString(EMailAddress), AnsiString(EMailName));
  EMail.Subject := AnsiString(Subject);
  EMail.Body := AnsiString(Body);
  EMail.HtmlBody := False;  // True if it's HTML email

  // Send attachment if wanted
  EMail.Attachments.Add(AnsiString(FileName));
  EMail.Send(True);   // True to show default email, false to add to outbox
finally
  EMail.Free;
end;

SimpleMAPI 的缺点是是一个短期解决方案(尽管它仍然存在于Win7 64位及更低版本中,但我不能说Windows 8)。根据 MSDN

The drawback to SimpleMAPI is that it may be a short-term solution (although it's still around in Win7 64-bit and earlier, I can't speak for Windows 8). According to MSDN,


[不建议使用简单MAPI。它可能会在Windows的后续版本中更改或不可用。]

[The use of Simple MAPI is discouraged. It may be altered or unavailable in subsequent versions of Windows.]

MAPI 依赖于已安装的 MAPI 客户端。幸运的是,几乎所有支持 mailto 的软件也应支持 MAPI 。例如,Outlook就是这样,Mozilla Thunderbird也是。

The drawback to MAPI is that it relies on a MAPI client being installed. Fortunately, almost any software that supports mailto should support MAPI as well; Outlook does, for instance, and so does Mozilla Thunderbird.

这篇关于发送带签名的电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆