how to send mail in asp.net

Answer Posted / deep

MainMessage message = new MailMessage();
message.From = <email>;
message.To = <email>;
message.Subject= "Subject of the Message";
message.Body = "Body Text";
SmtpMail.SmtpServer = "localhost";
SmtpMail.Send(message);

MailMessage & SmtpMail are classes defined in ASP.Net FCL (Framework Class Library). In addition to the above, you must use IIS configuration applet to enable localhost to relay messages through the SMTP service.

Is This Answer Correct ?    5 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is session in http request?

551


Explain about solution explorer window?

615


what are the events raised in asp.net page life cycle?in which stage view state can be loaded?

547


What is session state server?

615


What are the advantages and limitations of query string?

566






What is diff. Between abstract class and an interface?

517


How you will improve web application performance?

544


Can asp.net work on an nt server?

551


We Only Know The Total Number Of Feet In The Farmyard. Write A Program that will compute the total number of rabbits and chickens in the farmyard. Assume number of feet in the farmyard are 40. how many rabbits and chickens are?

433


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

527


What are session state modes? List some of the important session state modes of asp.net.

528


What are different types of authentication techniques that are used in connection strings to connect .net applications with microsoft sql server?

526


What is http protocol and how it works?

527


What is validation in asp.net?

550


What are sessions in asp net?

519