Solved

Could not acces 'CDO.Message' object

Posted on 2004-10-20
3
419 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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Pagebreak issue while printing the aspx page 3 24
.NET tools for adding thread safety to a web app? 3 33
vb.net help 4 29
SQL LINE CONTINUATION ISSUE 12 33
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …

773 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