I am using ASP.NET 3.5 and C# for developing a web application on helpdesk.
I am send email to the admin when user lodges a complaint.

**My issue is when the mail with attachment(word,excel,jpg,bmp etc)
 is sent to admin by the user the attachment contains no data.**

Here is the code sample I used:

```
MailMessage mm = new MailMessage();
mm.To.Add(mail1@abcd.com);
mm.From = new MailAddress("web@abcd.com");

if (FileUpload1.HasFile) /// for checking if mail has attachment
{
  mm.Attachments.Add(new Attachment(FileUpload1.PostedFile.InputStream, ileUpload1.FileName));
}

mm.body="Test Message";

 mm.IsBodyHtml = true;

 //neceessary credentials are specified in web.config file

 SmtpClient ss = new SmtpClient(); 

 ss.Send(mm);

```