Hi everyone,
There is a code snippet for sending mail via c#.net application....It requires the header file System.Web.Mail...
All I wanted to know is that - is installation of iis a pre requisite for using this particular feature? please lemme know ... Any help would be appreciated... The code is sumthing like this:
System.Net.Mail.MailMessage mail = new System.Net.Mail.MailMessage();
System.Net.NetworkCredential cred = new System.Net.NetworkCredential("[email protected]", "password");
mail.To.Add("[email protected]");
mail.Subject = "Reminder";
mail.From = new System.Net.Mail.MailAddress("[email protected]", "def");
mail.IsBodyHtml = true;
mail.Body = "This is a system generated mesage";
System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient("smtp.gmail.com");
smtp.UseDefaultCredentials = false;
smtp.EnableSsl = true;
smtp.Credentials = cred;
smtp.Send(mail);
thanx again

Dipa AhujaRank #1,168 · 1.5K reputationPosted Apr 25, 2010, 6:29 AM EDT
Hirendra SisodiyaRank #258 · 9.8K reputationPosted Apr 26, 2010, 3:22 AM EDT
You need to smtp service in running state, so you need to installl IIS on that machine...
thanks
Please mark as answere if it helps
Sam HobbsRank #107 · 20.5K reputationPosted Apr 26, 2010, 12:47 PM EDT
So don't use System.Web.Mail.
I doubt that you need to install IIS. The SmtpClient Class documentation explains how to set up IIS if you need to send mail using from a ASP.NET application, but if your application is not a ASP.NET application then I doubt that you need IIS.