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 are the differences between code behind and code inline?
What is the biggest disadvantage of “Other Return Types” in Web API?
What are the differences between the response.write() and response.output.write()?
Mention few asp.net validators.
How do I use a proxy server when invoking a web service?
What is difference between mvc and asp.net? : Asp.Net MVC
Can more than one person use the same login?
What are the advantages of using sql stored procedures instead of adhoc sql queries in an asp.net web application?
What is session in http request?
What is sta?
What is an il?
What are the versions of garbage collection?
What's the difference between viewstate and sessionstate?
explain code with datachaching with example
Explain the difference between globalization and localization techniques