Hi:
I'm trying to send e-mail using SMTP class. I'm getting error "Could not
access CDO.Message object." I know my SMTP server is working because I
can drop a text file message in "Pick-up" directory and it gets sent to
destination. It also works when I set SmtpMail.SmtpServer
prop to my ISP's smtp server (smtp.comcast.net), but not when I point to my
local server. I have tried using SmartHost, but still get same message. I
must be missing something????????
// Format email message
string from = txtEmail.Text;
string to = "ch*****@comcast.net";
string subject = "Web Contact" ;
string body = "Name: " + txtFname.Text + " " + txtLname.Text + '\n' +
"Phone: " + txtPhone.Text + '\n' +
"Organization: " + txtOrg.Text + '\n' +
"Message: " + txtMsg.InnerHtml;
try
{
// Send message
SmtpMail.SmtpServer = "localhost";
SmtpMail.Send(from, to, subject, body);
lblMsg.Text = "Mail sent, thank you.";
}
catch (Exception excp)
{
lblMsg.Text = excp.Message;
}
Thanks,
Charlie