mail attachment program in c#

Discussion in 'ASP .Net' started by vinodkus@gmail.com, Jun 1, 2007.

  1. Guest

    MailMessage MyMail = new MailMessage();
    MyMail.To = txtTo.Text;
    MyMail.From = txtFrom.Text;
    MyMail.Subject = txtSubject.Text;
    MyMail.Cc = txtCC.Text;
    MyMail.Body = txtBody.Text;

    ******** MyMail.Attachments.Add(how can u put browse file
    inside it);*****************

    SmtpMail.Send(MyMail);

    please give full code
    i have done it in vb.net but i want to do it in c#
    , Jun 1, 2007
    #1
    1. Advertising

  2. Hello ,

    > MailMessage MyMail = new MailMessage();
    > MyMail.To = txtTo.Text;
    > MyMail.From = txtFrom.Text;
    > MyMail.Subject = txtSubject.Text;
    > MyMail.Cc = txtCC.Text;
    > MyMail.Body = txtBody.Text;
    > ******** MyMail.Attachments.Add(how can u put browse file
    > inside it);*****************


    which file?

    See msdn http://msdn2.microsoft.com/en-us/library/system.net.mail.mailmessage.aspx

    > SmtpMail.Send(MyMail);
    >
    > please give full code
    > i have done it in vb.net but i want to do it in c#


    Try online code translators http://www.carlosag.net/Tools/CodeTranslator/Default.aspx
    http://www.developerfusion.com/utilities/convertcsharptovb.aspx

    ---
    WBR, Michael Nemtsev [.NET/C# MVP].
    My blog: http://spaces.live.com/laflour
    Team blog: http://devkids.blogspot.com/

    "The greatest danger for most of us is not that our aim is too high and we
    miss it, but that it is too low and we reach it" (c) Michelangelo
    Michael Nemtsev, Jun 1, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    2
    Views:
    499
    Paul Lesnikowski
    Nov 10, 2005
  2. Bertus Dam
    Replies:
    0
    Views:
    447
    Bertus Dam
    Aug 26, 2003
  3. Chris Welch
    Replies:
    1
    Views:
    325
    S. Justin Gengo
    Nov 25, 2003
  4. Replies:
    1
    Views:
    487
    Mark Rae
    Jun 2, 2007
  5. Deep
    Replies:
    2
    Views:
    839
    Evertjan.
    Jun 14, 2010
Loading...

Share This Page