Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
3
Reply
Sending mails through C#.net
d kris
Apr 25 2010 8:18 AM
2.4k
Reply
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
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
3
)
Next Recommended Forum
Urgent Help in making DATAGRID text buttons !!!
Making an Autorun for cd using c#