Solved

Could not acces 'CDO.Message' object

Posted on 2004-10-20
3
417 Views
Last Modified: 2010-04-24
Could not acces 'CDO.Message' object

This is the error that I get.

It works on my own pc, but not on an other (WinXP prof, office2000, old  exchange server)
It worked on an other pc, but I had to format him (Win2000)
I even put the 'System.Web.dll' local (dll that i reference)

    Private Sub EmailFile(ByVal EmailAdres As String, Optional ByVal Onderwerp As String = "Automatische zending sanitel lijsten", Optional ByVal StrFilepath As String = "")
        Dim Mailtje As New MailMessage()
        Dim Bijlage As MailAttachment
        If StrFilepath <> "" Then
            Bijlage = New MailAttachment(StrFilepath)
            Mailtje.Attachments.Add(Bijlage)
        End If
        With Mailtje
            .From = "Helpdesk@Company.be"
            .To = EmailAdres
            .Body = "Bestanden zijn automatisch toegevoegd in bijlage"
            .Subject = Onderwerp
        End With
        Try
            SmtpMail.Send(Mailtje)
        Catch ex As Exception
            LogWriter(ex.Message)
            Exit Sub
        End Try
        LogWriter("email verstuurd " & StrFilepath)
    End Sub

Does anybody know anything about this?
0
Comment
Question by:Droezel
3 Comments
 
LVL 20

Assisted Solution

by:ihenry
ihenry earned 250 total points
Comment Utility
It's hard to tell what happened without knowing the exception stack trace. Take a look to this article, and let me know if it can be any of help.

http://www.systemwebmail.com/faq/4.aspx
0
 
LVL 4

Accepted Solution

by:
Glom earned 250 total points
Comment Utility
"Could not acces 'CDO.Message' object" is a general error message and means everything and nothing. If you want to see the actual error message, try to put this in your code

instead of :

       Try
            SmtpMail.Send(Mailtje)
        Catch ex As Exception
            LogWriter(ex.Message)
            Exit Sub
        End Try

put the following code :

       Try
            SmtpMail.Send(Mailtje)
        Catch ex As Exception
            LogWriter(ex.InnerException.InnerException.Message)
            Exit Sub
        End Try

You should now be able to have the correct error message and correct it easily ;)

Glom
0
 

Author Comment

by:Droezel
Comment Utility
The 'SendUsing' configuration value is incorrect.

Thanx to Glom I traced the error, and the link ihenry provided was the solution :

SmtpMail.SmtpServer = "mail"

Points raised and split in 2
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now