用于 ASP.NET 服务器的 Word 邮件合并
需要为 ASP.NET 应用程序进行邮件合并。
考虑只是以编程方式直接使用 word,但这具有许可含义,不建议这样做 (http://support.microsoft. com/kb/257757)
因此我们正在研究 openXML / Word 自动化服务。但不确定是否可以通过此轻松实现邮件合并?
Need to do a mail merge for ASP.NET application.
Considered just programatically using word directly but this has liscening implications and is not recommended (http://support.microsoft.com/kb/257757)
So was looking into openXML / Word Automation Services. But not sure if can easily achieve a mail merge via this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
4-5 年前我们就有这样的需求,然后我们决定采用定制的自制解决方案。以下是可能对您有所帮助的解决方案概要:
实际上,这可能意味着根据实际需求进行大量工作。例如,在我们的案例中,
如果有任何预构建的工具用于此类事情,那就太好了,但因此我不知道任何事情。
编辑:如果您的要求是拥有用户定义的邮件模板,则上述所有内容都是相关的。如果您只有预定义的模板集,那么解决方案可能会简单得多 - 例如,(正如 Yves 指出的)使用带有数据绑定表达式的 aspx 文件来获取 html/xml 正文,然后将其转换为相关格式。然后,您可以使用 HttpServerUtility.Execute 来捕获任意数量记录的页面输出。
We had such requirement 4-5 years back and then we decided to go with custom self-made solution. Here's the outline of solution that may help you:
In reality, this may mean a lot of work based on actual requirements. For example, in our case
It would be great if there is any pre-built tool for such thing but as such I am not aware of anything.
EDIT: All above is relevant if your requirements is to have user defined mail templates. If you have only predefined set of templates then solution can be a lot simpler - for example, (as Yves pointed out) using aspx files with data binding expressions to get the html/xml body and then convert it into relevant format. You can then use HttpServerUtility.Execute to capture page output for any number of records.