在Delphi客户端服务器应用程序中存储电子邮件的想法 [英] Ideas for storing e-mail messages in a Delphi client server application

查看:175
本文介绍了在Delphi客户端服务器应用程序中存储电子邮件的想法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这里有很多建议用于存储电子邮件。不知怎的,我在做的是编写一个Outlook插件,将收件箱/发送的文件夹中的邮件直接发送到我的应用程序。

There are many suggestions here and there for storing e-mail messages. Somehow what I am doing is writing an Outlook addin to send emails from inbox/sent folders directly to my application.

所以只有真正有趣的东西才能被保存。我决定在哪里保存。

So only what is really interesting is saved. And I decide where to save it.

想象一下这种情况:

我收到客户的电子邮件。由我决定是否应该将其保存在客户或客户所做的订单24上。所以这就是为什么我正在加入,而不是一些自动存储电子邮件=一段时间后的噪音。

I recieve an email from a customer. It's up to me to decide whether I should save it on the customer or on the order 24 that that customer did. So this is why I am doing the add in, and not some automatic storing of emails = noise after some time.

这说,如何存储电子邮件?对于通过Outlook接收或发送的电子邮件,这个想法可以将整个文件保存在一个blob字段(所以是eml文件)中,也可以在另一个文本字段中保存其他信息(如主题)。但是,当我从我的应用程序中写下一封电子邮件时,问题出现。

This said, how to store the emails? For the emails that I recieve or send through Outlook the idea could be save the whole file in a blob field (so the eml file), may be I can save also other info (like the subject) in another text field. But the problem comes when I write an email from my application.

在这种情况下,我没有生成一个eml文件,我通过MAPI数据发送到Outlook来撰写邮件我会用Outlook发送(所以在这种情况下我不能保存eml),或者我直接用Indy发送它。另外在这种情况下,我没有eml文件...

In this case I am not generating an eml file, I send through MAPI data to Outlook to compose an email that I will send with Outlook (so in this case I cannot save the eml), or I directly send it with Indy. Also in this case I don't have the eml file...

一个想法可能是,我自动撰写的所有电子邮件都有一个特殊的标志,添加在识别,因此当我发送邮件它被存储回数据库。所以在这种情况下,我可以保存我从我的应用程序发送的邮件的eml。

One idea could be that the all the emails that I auto compose have a special flag that the Add in recognises and therefore when I send the mail it is stored back to the DB. So in this case I can save the eml also of the mails I sent from my application.

你可以评论吗?

推荐答案

首先,您必须决定您想要存储哪些信息。其余的只是一个方法来到那里。

First you have to decide on on what information you want to store. The rest is just a means to get there.

一个选项是存储.msg文件(你已经发布了相关的问题,建议你对MAPI不陌生)代替的.eml文件。使用MAPI,您可以将您创建的IMessage存储为.msg文件(有一点痛苦)。然而,并不是所有的mapi道具都将被设置,直到消息实际发送,你可能需要挂起outlooks发送项目文件夹。

One option is to store the .msg files (you have posted related questions suggesting you are no stranger to MAPI) in stead of .eml files. Using MAPI you can store the IMessage you created as a .msg file (with a bit of pain). However, not all mapi props will be set until the message actually is sent, you so might need to hook outlooks send items folders for that.

一个更直接的解决方案要直接从源生成.eml(或任何你喜欢的基于文本的格式)。发送时,将您的源数据,生成正确的MAPI调用outlook并生成.eml并将其直接存储到数据库中。收到后,将Outlook保存到.eml直接。

A much more straightforward solution would be to generate the .eml (or whatever textbased format you prefer) directly from the source. When sending, take your source data, generate the correct MAPI calls to outlook AND generate the .eml and store it directly into your database. When recieving, have Outlook save to .eml directly.

个人而言,我根本不会使用.eml进行存储。我会将我特别感兴趣的数据(像/从地址)分析成单独的列。最后,您可能正在使用数据库进行数据检索。当您不将所有内容存储在单个备忘录/ blob字段中时,数据库往往会做得更好。 :)

Personally, I wouldn't use .eml at all for storage. I would parse the data I'm particularly interested in (like to/from addresses) into separate columns. In the end, you are probably using your DB for data retrieval. Databases tend to do a better job when you don't store everything in a single memo/blob field. :)

这篇关于在Delphi客户端服务器应用程序中存储电子邮件的想法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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