How do I send e-mail from an ASP.NET application ?
Answer / 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 |
How to find last error which occurred?
Where on the Internet would you look for Web services?
5 Answers IBM, MNC, Siebel Systems,
What is difference between machine.config and Web.Config?
4 Answers Accenture, BirlaSoft, Le Logiciel,
What is data binding in asp net?
Explain the significance of routing? : asp.net mvc
how to pass session value one url to another url.my code if session("user")="abc" then response.redirect("www.abc.com\client\home.aspx") end if. so how to pass value of session in browser url
How to retrieve user name in case of Window Authentication?
What do you mean by authorization?
What is a Metadata?
what is page life cycle state management postback cross page postback types of feilds in gridview gridview events their life cycle cte in sql diff truncate and delete paging concepts in gridview diff bet gridview datalist and repeater what new operations in sql 2005 compared to earlier you get
What is session in web technology?
About web methods and its various attributes ?