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 ?

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between asp.net and mvc?

1113


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

1039


Explain the difference between an exe and a dll?

1002


What are the advantages of the code-behind feature?

982


What is the difference between c# and .net?

1040


How can we communicate with each server in N-tier Architecture? and what are the methods?

2232


What is the extension of master page in asp.net?

976


How does ASP.NET framework maps client side events to Server side events.?

1088


What are the advantages and disadvantages of Using Cookies?

969


what is command line compiler.what are the steps and how it is related to debugging.

1879


Which object is used to encapsulate the state of the client and the browser in ASP.NET?

1094


What is a web pool?

1113


Explain the differences between clr & cts?

1000


What is the difference between page-level caching and fragment caching?

966


What are the difference between function and stored procedure in .net programming language?

699