Answer Posted / kumar saurabh
MailMessage message = new MailMessage ();
message.From = <email>;
message.To = <email>;
message.Subject = "Scheduled Power Outage";
message.Body = "Our servers will be down tonight.";
SmtpMail.SmtpServer = "localhost";
SmtpMail.Send (message);
MailMessage and SmtpMail are classes defined in the .NET Framework Class Library's System.Web.Mail namespace. Due to a security change made to ASP.NET just before it shipped, you need to set SmtpMail's SmtpServer property to "localhost" even though "localhost" is the default. In addition, you must use the IIS configuration applet to enable localhost (127.0.0.1) to relay messages through the local SMTP service.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is the difference between mvc and asp.net? : Asp.Net MVC
What are session state modes?
How does http session work?
Explain the main function of razor in asp.net? : asp.net mvc
Web API uses which library for JSON serialization?
What are strong names?
Why does my asp.net file have multiple tag with runat=server?
Where is the view state data stored?
How to make paging concepts in datagrid in ASP.NET?
What is the advantage of using Windows authentication in a Web application?
Is web config mandatory?
Difference between .NET and previous version?
Explain some of the major built-in objects in asp.net
What is the current version of asp.net?
Do session use cookies in asp net?