Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Could not acces 'CDO.Message' object

Posted on 2004-10-20
3
Medium Priority
?
431 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 1000 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 1000 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
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…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

610 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