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 asp.net and mvc?
Can the validation occurs in server-side or client-side? If the validation occurs why should we do?
Explain the difference between an exe and a dll?
What are the advantages of the code-behind feature?
What is the difference between c# and .net?
How can we communicate with each server in N-tier Architecture? and what are the methods?
What is the extension of master page in asp.net?
How does ASP.NET framework maps client side events to Server side events.?
What are the advantages and disadvantages of Using Cookies?
what is command line compiler.what are the steps and how it is related to debugging.
Which object is used to encapsulate the state of the client and the browser in ASP.NET?
What is a web pool?
Explain the differences between clr & cts?
What is the difference between page-level caching and fragment caching?
What are the difference between function and stored procedure in .net programming language?