send a mail with an attachment in asp.net
<pre><code>HttpFileCollection hfc = Request.Files;
    for (int i = 0; i &lt; hfc.Count; i++)
    {
       HttpPostedFile hpf = hfc[i];
       if (hpf.ContentLength &gt; 0)
    {

    //hpf.SaveAs(MapPath("~/myfiles/"+  System.IO.Path.GetFileName(hpf.FileName)));
    string fileName = hpf.FileName;
    int len = hpf.ContentLength;
    byte[] file = new byte[len];
    ITSDAO.Attachments atc = new ITSDAO.Attachments();
    atc.Attachment = file;
    //atc.Attachment = file;
    atc.Add(TicketDtlId, file, fileName);
    //atc.Add(TicketDtlId, file, fileName);
}
</code></pre>
