开发者

Mailmerge in asp.net

How to do a mail merge in asp.net without installing word on 开发者_C百科the server?

any dlls or any components available?

Edits

The template document is already available. im not trying to create a word document. Just want to link the word document with the data.

Thanks


Personally, I would just look at using the System.Net.Mail class and its templating abilities. There is a nice library here: https://github.com/lukencode/FluentEmail which you can pass templates into and send emails that way with the data you require inserted into it.

EDIT: noticed you didn't actually specify whether it was print mailmerge or email, apologies if it is a print mailmerge you are trying to create, but for mass emailing with customized data in it, templating is definitely the way to go.


To accomplish the Word doc creation part of the question there is a previous thread about this: How can a Word document be created in C#?

To send the completed doc check out the System.Net.Mail namespace: http://msdn.microsoft.com/en-us/library/system.net.mail.aspx or if you can afford it I have had great experience with http://www.aspnetemail.com/.


We use Aspose.Words to perform mail merges from .net code. It's not cheap but once you get to grips with it it's very powerful.

Edit: I'm assuming you are looking to merge data from some sort of data store into a template word document which can be printed and distributed.


Another option is Docentric Toolkit. It is pure .NET and based on OpenXML without any dependency on MS Word, so it is a good fit for server side report generation.

Merging with data is done through placeholders, which get filled up with data at run time. Data can come from database or XML.

Templates are created in MS Word which needs Docentric Toolkit add-in installed (license is needed).

It is really easy to create templates and to merge them with data from .NET code.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜