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
Sam HobbsPosted Apr 26, 2010, 4:47 PM
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.
Hirendra SisodiyaPosted Apr 26, 2010, 7:22 AM
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
Dipa AhujaPosted Apr 25, 2010, 10:29 AM