使用客户端的电子邮件应用程序使用附件发送电 [英] Send email with attachment using client's email application

查看:356
本文介绍了使用客户端的电子邮件应用程序使用附件发送电的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要我的本地安装的胖客户端应用程序(Qt / C ++)在客户端计算机上生成现成的电子邮件:




  • 此邮件必须包含相对较小(15K - 200K)二进制文件的内容。

  • 我的很多用户在此邮件

  • 此应用程序将在Windows,Mac OS X和各种Linux发行版上运行(官方支持Ubuntu / Debian和Fedora),并且不需要安装特定的电子邮件客户端。



我已经尝试过: / p>


  • 使用打开 mailto:链接QDesktopServices :: openUrl (或附件)参数使用附加但是这些参数并不是协议的正式组成部分,而且一些客户端(特别是Outlook)忽略它们。

  • 使用Base64编码文件并将其添加为 body 参数 mailto:链接。但是 mailto 链接的长度被一些电子邮件客户端截断(尤其是Outlook),因此这将不起作用。



当您在应用程式内传送图片时,Google Picasa会达到这个目的(至少在Windows上;尚未检查其他作业系统)。它创建一个包含附件和一些预填充文本的邮件。然后,您可以编辑邮件并在您方便时发送。

解决方案

您可以创建一个.eml文件并打开它,只要有任何电子邮件客户端在系统中注册以处理带有此扩展名的文件。我确定这不像 mailto:方案那样通用,但如果 mailto:认为这可能是尝试的第二个最佳选择。



http:/ /www.coolutils.com/Formats/EML


由于EML档案的建立符合行业标准
RFC 822标准,
他们可以用于大多数电子邮件
客户端,服务器和应用程序。
除了Microsoft Outlook Express,
EML文件可以使用大多数
电子邮件客户端打开,例如Microsoft
Outlook,Microsoft Entourage,Mozilla
Thunderbird,Apple邮件和
IncrediMail。


侧边注

当我点击电子邮件 Picasa我得到对话框,我可以选择哪个应用程序(Thunderbird或Google Mail)我想发送电子邮件。这意味着Picasa知道用于发送电子邮件的特定电子邮件客户端,并可以使用特定于所选电子邮件客户端的自定义方法来发送电子邮件。这当然只是推测,但可能是Picasa使用户选择电子邮件客户端,因为没有一般的方法来做你所问问。


I need my locally-installed, thick-client application (Qt / C++) to generate a ready-to-be-sent email message on the client's machine:

  • This message must contain the contents of a relatively small (15K - 200K) binary file.
  • Many of my users will be disconnected at the time this message is generated, so it is possible the email will need to sit in the outbox until a later time.
  • This application will run on Windows, Mac OS X, and various Linux distros (official support for Ubuntu/Debian and Fedora), and there is no requirement that specific email clients need to be installed.

I have already tried:

  • Opening a mailto: link using QDesktopServices::openUrl() with the attach (or attachment) parameter. But those parameters are not officially part of the protocol, and some clients (notably Outlook) ignore them.
  • Encoding the file using Base64 and adding it as part of the body parameter of a mailto: link. But the length of the mailto link is truncated by some email clients (again, notably Outlook) so this will not work.

Google Picasa achieves this (at least, on Windows; haven't checked other OS's) when you send pictures from within the application. It creates a message with the attachments and some pre-filled text. You can then edit the message and send at your convenience. Any ideas how they are doing this?

解决方案

You could create an .eml file and open it which should give you the effect you want as long as there is any email client registered in the system to handle files with this extension. I'm sure this is not as universal as the mailto: scheme but if mailto: does not work for you I think this could be the second best option to try.

From http://www.coolutils.com/Formats/EML

Since EML files are created to comply with the industry RFC 822 standard, they can be used with most e-mail clients, servers and applications. Besides the Microsoft Outlook Express, EML files can be opened using most e-mail clients, such as Microsoft Outlook, Microsoft Entourage, Mozilla Thunderbird, Apple Mail, and IncrediMail.

Side note
When I click 'E-mail' in Picasa I get dialog where I can choose which application (Thunderbird or Google Mail) I want to send email with. This means Picasa knows specific email client being used to send email and can use custom method, specific to chosen email client, to send email. This is of course just speculation but it might be that Picasa makes user to choose email client because there's no generic way to do what you ask about.

这篇关于使用客户端的电子邮件应用程序使用附件发送电的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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