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 |
Define page fragment caching?
After capturing the SelectIndexChanged event for a ListBox Control, you find that the event handler doesn?t execute. What could be the problem be? a) The AutoEventWireup attribute is set to False b) The AutomaticPostBack attribute is set to False c) The codebehind module is not properly compiled d) The ListBox must be defined WithEvents.
Can One website be made using two different languages like c#,vb.net etc......
Hi, I am a fresher. i have a problem related to DataGrid . i have a data grid and i have to place a dropdown in the datagrid.and i have to retrieve the values from the database (sqlserver).please tell me any idea about the code.
Who can consume WebAPI?
What is odata in web api?
If we write return statement in finally block will it works fine or throws any error?
How can we Validate a Controls in ASP.NET page using JavaScript?
Is asp net front end or backend?
Explain in what order a destructors is called.
How would one do a deep copy in .NET?
Name the namespace which is used by ado.net?