Problems with SMTP server- can not access CDO object error...

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Charles Fineblum

    #1

    Problems with SMTP server- can not access CDO object error...

    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.SmtpSe rver
    prop to my ISP's smtp server (smtp.comcast.n et), 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 = "charle1@comcas t.net";
    string subject = "Web Contact" ;
    string body = "Name: " + txtFname.Text + " " + txtLname.Text + '\n' +
    "Phone: " + txtPhone.Text + '\n' +
    "Organizati on: " + txtOrg.Text + '\n' +
    "Message: " + txtMsg.InnerHtm l;
    try
    {
    // Send message
    SmtpMail.SmtpSe rver = "localhost" ;
    SmtpMail.Send(f rom, to, subject, body);
    lblMsg.Text = "Mail sent, thank you.";
    }
    catch (Exception excp)
    {
    lblMsg.Text = excp.Message;
    }

    Thanks,
    Charlie


Working...