DIGIT-ARC read-only archive · snapshot: July 23, 2026

How to send mail from C# form??

4 posts · originally from https://geek.digit.in/community/threads/how-to-send-mail-from-c-form.75144/

blademast3r
blademast3r Original post #1
Dec 8, 2007 at 12:39 PM
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
RCuber #2
Dec 8, 2007 at 1:15 PM
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?
E
expvice #3
Feb 26, 2009 at 12:10 AM
hi, there is a good sample in that link, i hope it helps you

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