I am trying to attach multiple Image files to mail from file upload control.
Its being attached but when I am trying to open those image its not opening.
below codes for more clarity
using (MailMessage mm = new MailMessage(senderId, receiverId))
{
foreach (HttpPostedFile uploadedFile in imgUpload.PostedFiles)
{
string FileName = Path.GetFileName(uploadedFile.FileName);
mm.Attachments.Add(new Attachment(uploadedFile.InputStream, FileName));
}
}
where
imgUpload= file upload control with AllowMultiple properties "
true"
Thanks In Advance
What I have tried:
using (MailMessage mm = new MailMessage(senderId, receiverId))
{
foreach (HttpPostedFile uploadedFile in imgUpload.PostedFiles)
{
string FileName = Path.GetFileName(uploadedFile.FileName);
mm.Attachments.Add(new Attachment(uploadedFile.InputStream, FileName));
}
}