Hi..
Can some1 help me about how to send emails using asp.net.... i m using windows 2000 server and .net framework 1.1....... plz help me.....
Hi..
You can use thsi code to send mail as below:
[C# .NET]
using System.Web.Mail;
MailMessage objEmail = new MailMessage();
objEmail.To = txtTo.Text;
objEmail.From = txtFrom.Text;
objEmail.Cc = txtCc.Text;
objEmail.Subject = "Test Email";
objEmail.Body = txtBody.Text;
//SmtpMail.SmtpServer = "localhost";
try
{
SmtpMail.Send(objEmail);
Response.Write("Your Email has been sent sucessfully");
}
catch (Exception exc)
{
Response.Write("Send failure: " + exc.ToString());
}
-Ankit