Could not access 'CDO.Message' object.

Results 1 to 2 of 2

Thread: Could not access 'CDO.Message' object.

  1. #1
    Join Date
    Dec 1969

    Default Could not access 'CDO.Message' object.

    I get this error when trying to send an email attahcment.<BR><BR>Doe sanyone know what is wrong with this code?<BR><BR><BR>Response.Write("test");<BR>string sPath = "";<BR>string fileTitle ="";<BR>MailMessage mail = new MailMessage();<BR><BR> <BR> mail.To = "myemail";<BR> mail.From = "anotheremail";<BR> mail.Subject = "PACIFIC Attachment";<BR><BR> mail.BodyFormat = MailFormat.Text;<BR> mail.Body = "Check out the attachment!";<BR><BR><BR>mail.Subject = Request.Form["subject"];<BR>mail.Body = Request.Form["body"];<BR><BR><BR>if(Request.Form["attachment"]!="") <BR>sPath="d:\webserveraddress\;<BR>fileTitle = attachment.PostedFile.FileName;<BR>fileTitle = fileTitle.Substring(fileTitle.LastIndexOf("\") + 1);<BR>attachment.PostedFile.SaveAs(sPath+ fileTitle);<BR>mail.Attachments.Add(new MailAttachment(sPath+fileTitle));<BR>System.IO.Fil e.Delete(sPath+ fileTitle);<BR>try{ SmtpMail.Send(mail); } <BR>catch(Exception MailEx){Info.Text+=MailEx.Message;}<BR><BR><BR>}<B R>It appears to add the file as an attahment then delete the file but teh I get an error when trying to send <BR><BR>Could not access &#039;CDO.Message&#039; object.<BR><BR>what is this and how do I fix it. ive looked around but no answers<BR><BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Could not access 'CDO.Message' objec

    do you have the SMTP service installed?<BR><BR><BR>j<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts