How to Create/Format Forward & Reply Email Messages inside .NET Apps
This technical tip explains how .NET developers can Create the Forward & Reply Email Messages inside .NET Applications using Aspose.Email for .NET. Aspose.Email API provides the capability of creating and formatting the forward and reply messages. The ReplyMessageBuilder and ForwardMessageBuilder classes of the API are used to create the Reply and Forward messages respectively. A Reply or Forward message can be specified to be created using any of the modes of OriginalMessageAdditionMode enum.
//your code here...// Creating Reply Message
//[C# Code Sample]
MapiMessage originalMsg = MapiMessage.FromFile("original.msg");
ReplyMessageBuilder builder = new ReplyMessageBuilder();
builder.ReplyAll = true;
builder.AdditionMode = OriginalMessageAdditionMode.Textpart;
builder.ResponseText = "<p><b>Dear Friend,</b></p> I want to do is introduce my co-author and co-teacher. <p><a href=\"www.google.com\">This is a first link</a></p><p><a href=\"www.google.com\">This is a second link</a></p>";
MapiMessage replyMsg = builder.BuildResponse(originalMsg);
replyMsg.Save("reply.msg");
//[VB.NET Code Sample]
Dim originalMsg As MapiMessage = MapiMessage.FromFile("original.msg")
Dim builder As New ReplyMessageBuilder()
builder.ReplyAll = True
builder.AdditionMode = OriginalMessageAdditionMode.Textpart
builder.ResponseText = "<p><b>Dear Friend,</b></p> I want to do is introduce my co-author and co-teacher. <p><a href=""www.google.com"">This is a first link</a></p><p><a href=""www.google.com"">This is a second link</a></p>"
Dim replyMsg As MapiMessage = builder.BuildResponse(originalMsg)
replyMsg.Save("reply.msg")
//Creating Forward Message
//[C# Code Sample]
ForwardMessageBuilder builder = new ForwardMessageBuilder();
builder.AdditionMode = OriginalMessageAdditionMode.Textpart;
MapiMessage forwardMsg = builder.BuildResponse(originalMsg);
forwardMsg.Save("forward.msg");
//[VB.NET Code Sample]
Dim builder As New ForwardMessageBuilder()
builder.AdditionMode = OriginalMessageAdditionMode.Textpart
Dim forwardMsg As MapiMessage = builder.BuildResponse(originalMsg)
forwardMsg.Save("forward.msg")
Url: http://www.aspose.com/.net/email-component.aspx
Language: C# | User: Sheraz Khan | Created: May 11, 2016 | Tags: Creating Reply Message Creating Forward Message Create forward email message .NET Email API create RE or FW message Send Reply email message