hello,
i am working on windows based application in C#.i want to send a mail on a button click but i m getting an error while executing the application. The error is "Could not access 'CDO.Message' object"
my code on button click is as under
private
void btnSndMail_Click(object sender, System.EventArgs e)
{
string strMailBody="Hello this is test";
MailMessage objMsg=
new MailMessage();
objMsg.To=
[email protected];
objMsg.From=
"[email protected]";
objMsg.BodyFormat=MailFormat.Text;
objMsg.Body=strMailBody;
SmtpMail.SmtpServer=
"localhost;
SmtpMail.Send(objMsg);
}
plz help .........