By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,214 Members | 2,072 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,214 IT Pros & Developers. It's quick & easy.

mail attachment program in c#

P: n/a
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 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hello vi******@gmail.com,
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/lib...ilmessage.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/CodeTr...r/Default.aspx
http://www.developerfusion.com/utili...sharptovb.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
Jun 1 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.