# How to send mail from C# form??



## blademast3r (Dec 8, 2007)

hey coders!

how exacltly do i send a mail from a c# app usin c# code...i kno it has smthin to do wid the system.net.mail class but how exaclty do i implement it??

the mail shud basically contain a subject, sender nd mail contennt....


----------



## RCuber (Dec 8, 2007)

Check the System.web.mail; There is a class called MailMessage from which you can send the mail

you can build the email message with properties like from , to , cc , bcc , priority , subject , body etc etc, 
Once you built the message, you can use the SMTP mail object to send message you just created.

I will not be posting the code for this here cause others may missuse it. PM me if you want a sample code.

And do you have your own SMTP mail server? are you using this is ASP.NET for winform application?


----------



## expvice (Feb 26, 2009)

hi, there is a good sample in that link, i hope it helps  you

*www.expvice.com/code.aspx?id=16


----------



## kin.vachhani (Feb 26, 2009)

expvice said:


> hi, there is a good sample in that link, i hope it helps  you
> 
> *www.expvice.com/code.aspx?id=16



The link is very nice ful...thx bro


----------

