Hi,
Testing these fields:
#DrawingName#
#Artist#
#IndexedDate#
End Test
Testing these fields:
Mona Lisa
da Vinci
#IndexedDate#
End Test
Hi,
Hi,
MailMessage template = new MailMessage();
//add template field to subject
template.Subject = “Hello, #FirstName#”;
template.From = new MailAddress(“dgertz@mycompay.com”, “dgertz@mycompay.com”);
//add template field to receipt
template.To.Add(new MailAddress(“#Receipt#”, true));
//add template field to html body
template.HtmlBody = “Dear #FirstName# #LastName#
Sent Date : #Date#”;
//create a new TemplateEngine with the template message.
TemplateEngine engine = new TemplateEngine(template);
//fill a DataTable as data source
DataTable dt = new DataTable();
dt.Columns.Add(“Receipt”, typeof(string));
dt.Columns.Add(“First Name”, typeof(string));
dt.Columns.Add(“Last Name”, typeof(string));
dt.Columns.Add(“Date”, typeof(DateTime));
DataRow dr;
dr = dt.NewRow();
dr[“Receipt”] = “aaa@hotmail.com”;
dr[“First Name”] = “Nancy”;
dr[“Last Name”] = “Davolio”;
dr[“Date”] = System.DateTime.Now;
dt.Rows.Add(dr);
dr = dt.NewRow();
dr[“Receipt”] = “aaabb@hotmail.com”;
dr[“First Name”] = “Andrew”;
dr[“Last Name”] = “Fuller”;
dr[“Date”] = System.DateTime.Now;
dt.Rows.Add(dr);
dr = dt.NewRow();
dr[“Receipt”] = “bbb@163.com”;
dr[“First Name”] = “Janet”;
dr[“Last Name”] = “Leverling”;
dr[“Date”] = System.DateTime.Now;
dt.Rows.Add(dr);
DataColumnMappingCollection mappings = new DataColumnMappingCollection();
mappings.Add(new DataColumnMapping(“Receipt”, “Receipt”));
mappings.Add(new DataColumnMapping(“Last Name”, “LastName”));
mappings.Add(new DataColumnMapping(“Date”, “Date”));
MailMessageCollection messages;
try
{
//Create messages from the message and datasource.
messages = engine.Instantiate(dt, mappings);
for (int i = 0; i < messages.Count; i++ )
{
messages[i].Save(“C:\temp\test”+i+“.eml”, MailMessageSaveType.EmlFormat);
}
}
catch (MailException ex)
{
System.Diagnostics.Debug.WriteLine(ex.ToString());
}
Using the Source Demo that comes with the new Aspose.Email, I altered the DataTable to have the same three columns as my example and I used the same html string in the textbox_message.Text. I got the same exact results that I’ve posted.
Hi,
Thank you for further information.
I am able to reproduce your said issue with this [sample project](https://apps.banckle.com/file/g/?v=tvzd9irNkmJ&f=MailMerge.zip)
. So I have recorded an investigative ticket in our bug tracking system under ticket ID 31579. We will look into this matter very soon and keep you posted with updates.
Regards,
The issues you have found earlier (filed as 31579 ) have been fixed in this update.
This message was posted using Notification2Forum from Downloads module by aspose.notifier.