hey yaar i develop the project in asp.net and i want to upload my file in my project and i want to send that usind w-mail so how can i use that file upload control please give me some examples...

>hey yaar

.. a very rude comment.

>i want to send that usind w-mail so how can i use that file upload control please give me some examples...

To send an email try this:

System.Net.Mail.SmtpClient sc = new System.Net.Mail.SmtpClient("put.her.smtp.serever.com", port);
 try
  {
  sc.Credentials = new System.Net.NetworkCredential("account_username", "password");

  System.Net.Mail.MailMessage msg = new System.Net.Mail.MailMessage(from, to, subject, body);

            
  System.Net.Mail.Attachment ac=new System.Net.Mail.Attachment(FileUpload1.PostedFile.InputStream,FileUpload1.FileName);
  msg.Attachments.Add(ac);

  sc.Send(msg);
            
 Label1.Text = "Message sent";
 }
 catch (Exception ex)
   {
       Label1.Text = "Can't sent.";
 }
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.