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

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

问题描述

我需要我的本地安装的胖客户端应用程序(Qt / C ++)来在客户端的计算机上生成一个即将发送的电子邮件消息:




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

  • 我的许多用户在此消息时将断开连接生成的,所以可能的电子邮件将需要坐在发件箱中,直到稍后的时间。

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



我已经尝试过: / p>


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

  • 使用Base64对文件进行编码,并将其作为 mailto的参数:链接。但是,某些电子邮件客户端(再次特别是Outlook)会截断 mailto 链接的长度,因此这将不起作用。



当您从应用程序中发送图片时,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天全站免登陆