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 register exception filter globally?
How to convert a string into an Integer in ASP.net?
Define a multilingual website?
How many web config files can be created for an application?
What is csrf attack in asp.net?
Whta are the Various steps taken to optimize a web based application (caching, stored procedure etc.) ?
List the asp.net validation controls?
what is mean by framework?
What does assemblyinfo.cs file consist of?
In which event of the page viewstate is available?
explain code with datachaching with example
What Is ASPNET_WP.exe? What Is The Use Of It? In Which Place Inproc Session Stored ? Explain Session State ?
2 Answers Phoenix Technologies,
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)