Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


How do I send e-mail from an ASP.NET application ?



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

Post New Answer

More ASP.NET Interview Questions

what is roles in asp.net

2 Answers  


Differentiate globalization and localization.

0 Answers  


What is authorization in asp.net?

0 Answers  


How does asp.net page work?

0 Answers  


Tell me the code snippet to show how we can return 404 errors from HttpError?

0 Answers  


How to deploy/publish webservices?How many ways?Plz explain me

0 Answers   TCS,


Define static constructor?

0 Answers  


Can the validation occurs in server-side or client-side? If the validation occurs why should we do?

0 Answers   Siebel,


Why Unload event of MasterPage Calls first in ASP.net ?

0 Answers   HCL,


What is strong name and which tool is used for this?

4 Answers   Accenture,


Define static member?

0 Answers  


How can you make sure that web api returns json data only?

0 Answers  


Categories