Solved

Could not acces 'CDO.Message' object

Posted on 2004-10-20
3
425 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…

707 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