0 votes

I want to insert more than 1 attachment in the mail to the mssql server through the procedure in C#.How can i possible to do it

by

1 Answer

0 votes

Use MailBuilder class and AddAttachment method multiple times:

MailBuilder builder = new MailBuilder();
builder.Subject = "Hello";
builder.Text= "Both files attached.";
builder.To.Add(new MailBox("to@example.com"));
builder.From.Add(new MailBox("from@example.com"));

builder.AddAttachment("c:\\a.txt");
builder.AddAttachment("c:\\b.txt");  

IMail email = builder.Create();
by (297k points)
...