adding attachment to email from browse button
<p>I'm trying to add an attachment to my email from a browse button in c#</p>

<p>Here is my code:</p>

<pre><code>string fileName = Path.Combine(Path.GetTempPath(),FileUploadControl.FileName);
using (FileStream fs = File.Open(fileName, FileMode.Create, FileAccess.Write, FileShare.Read))
{
    byte[] buffer = new byte[1024];
    int bytesRead; while ((bytesRead = fs.Read(buffer, 0, buffer.Length)) &gt; 0) 
    {
        fs.Write(buffer, 0, bytesRead);
    }
}

Attachment attachment = new Attachment(fileName);
msg.Attachments.Add(attachment);
</code></pre>

<p>$exception {"Stream does not support reading."} System.Exception {System.NotSupportedException}</p>

<p>what am i doing wrong?</p>
