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
Describe paging in asp.net?
What is server side in asp.net?
What do you mean by caching in asp.net?
What is difference between abstract class and an interface?
Give an example of what might be best suited to place in the application_start and session_start subroutines?
What are the major built-in objects in ASP.NET?
What is the function of new view engine in asp.net? : asp.net mvc
Explain security types in asp.net?
how to transfer the file from client to server using asp.net
What are the disadvantages of asp.net?
in which protocol ASP.NET WEB API Work?
What is the difference between runtime version and version?
What is data control in asp.net?
What are ASHX files?
How does the iis work?