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 count the number of objects present in a web page? How to count the number of radio buttons in a web page?
What is a web farm?
Why is global asax is used for?
How would you turn off cookies on one page of your website?
What is httpresponse?
What is Assert Method ?
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
How do you declare static variable? What is its lifetime?
One application have three forms for registration .submit button is at third form.after filling three forms only u have to click submit button.After clicking the submit button all the values in first,second& third form saved on sql server.how to handle this situation .
What is ViewState? What does the "EnableViewState" property do? Why would I want it on or off?
What are type/key pairs in client script registration? Can there be 2 scripts with the same type/key pair name?
Name and describe some HTTP Status Codes and what they express to the requesting client ?