How to send mail from C# form??

Status
Not open for further replies.

blademast3r

In the zone
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

The Mighty Unkel!!!
Staff member
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

Right off the assembly line
hi, there is a good sample in that link, i hope it helps you

*www.expvice.com/code.aspx?id=16
 
Status
Not open for further replies.
Top Bottom