ASP.Net Interview Questions and Answers
<< Previous Question Next Question >>
 Question: 605 Page Views: 

Whch classes are required to send a mail in asp.net and write code for it?



Posted By: Avi Date: 4 October 2010 02:13:19 AM
 Answer:

MailMessage and SmtpMail are the classes which will be required to send the mail. Code for this will be as follows:- MainMessage msg = new MailMessage(); msg.From = ; msg.To = ; msg.Subject= "Subject "; msg.Body = "Body Text"; SmtpMail.SmtpServer = "localhost"; SmtpMail.Send(msg);


Posted By: avibtech


Date: 4 October 2010 02:13:19 AM
Post a better Answer if you have
 
(Will show your Gravatar icon)  
  Country flag

Loading
Enter the text as shown in the image Dphy7i
Related Questions
ASP.Net : Which validation control can we use to make sure the values in two different controls matched?
ASP.Net : Can you tell me the two properties common in every validation controls?

Can you tell me the two properties common in every validation controls?

ControlToValidate property and Text property
Category: ASP.Net Date: 10/28/2009 4:44:15 AM
ASP.Net : What is the difference between trace and debug in ASP.NET?

What is the difference between trace and debug in ASP.NET?

Debug and trace enables you to monitor the application for errors and exception without VS.NET IDE. ....
Category: ASP.Net Date: 10/27/2009 4:56:34 AM
ASP.Net : How can we force all the validation controls to run?

How can we force all the validation controls to run?

Use following server-side C# code: Page.Validate();
Category: ASP.Net Date: 10/27/2009 4:49:04 AM
ASP.Net : What is impersonation in ASP.Net?

What is impersonation in ASP.Net?

Impersonation is when ASP.Net executes code in the context of an authenticated and authorized client....
Category: ASP.Net Date: 10/25/2009 6:08:34 AM