Mailing in C# Console Application

S

SatishPasala

hi

This is a very active group. Anyways

I am trying to add Mailing functionality to C# Console Application. How
do I get started with here... (I used to use System.Web.Mail in ASP.NET
Applications. I am not able to use the same here)

Any code samples or advise on how to proceed is welcome.

Thank You,
Satish Pasala
 
M

Mr Newbie

Just add a reference to the system.web.dll and create and imports statement
at the top of your class.
 
G

Guest

Q posted in wrong group though..

System.Web.Mail works in console applications. Following is a working code
from one of my app...

using System.Web.Mail;

public static void sendEmail(string mailTo, string mailFrom, string
mailSubject,
string mailBody)
{
MailMessage mm = new MailMessage();
mm.From = mailFrom;
mm.To = mailTo;
mm.Subject = mailSubject;
mm.Body = mailBody;
SmtpMail.SmtpServer = "your smtp server";
SmtpMail.Send(mm);
}

HTH
 
G

Guest

Just as an FYI, the System.Web.Mail is an obsolete type in .Net 2.0. You'll
have to look up the information about System.Net.Mail.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,280
Latest member
BGBBrock56

Latest Threads

Top