Solved

Could not acces 'CDO.Message' object

Posted on 2004-10-20
3
421 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
ID: 12358674
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
ID: 12359302
"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
ID: 12366855
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Close form "before" open 3 49
Modal Popup Extender control 1 39
vb.net 1 month apart 11 35
vb.net convert long time to mm:ss 23 13
Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…

820 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