C
Curious
Hi,
I wish to be able to send an email in my C#.NET code in the following
format:
MailMessage objEmail = new MailMessage();
objEmail.To = "(e-mail address removed)";
objEmail.From = "(e-mail address removed)";
objEmail.Subject = "Test Email";
objEmail.Body = "Price Mover test";
objEmail.Priority = MailPriority.High;
//SmtpMail.SmtpServer = "localhost";
try{
SmtpMail.Send(objEmail);
Response.Write("Your Email has been sent sucessfully -
Thank You");
}
catch (Exception exc){
Response.Write("Send failure: " + exc.ToString());
}
However, I know that I must use a namespace related to email. What is
that namespace?
Also neither "SmtpMail" nor "MailMessage" is recognized by the
compiler. Any advice on how to make this work?
Thanks!
I wish to be able to send an email in my C#.NET code in the following
format:
MailMessage objEmail = new MailMessage();
objEmail.To = "(e-mail address removed)";
objEmail.From = "(e-mail address removed)";
objEmail.Subject = "Test Email";
objEmail.Body = "Price Mover test";
objEmail.Priority = MailPriority.High;
//SmtpMail.SmtpServer = "localhost";
try{
SmtpMail.Send(objEmail);
Response.Write("Your Email has been sent sucessfully -
Thank You");
}
catch (Exception exc){
Response.Write("Send failure: " + exc.ToString());
}
However, I know that I must use a namespace related to email. What is
that namespace?
Also neither "SmtpMail" nor "MailMessage" is recognized by the
compiler. Any advice on how to make this work?
Thanks!