CDOSYS Sending mail probs

peterdoherty

Freshman
Joined
Feb 24, 2003
Messages
49
Hi there I am using CDOSYS on Win XP pro to try and send mail through ASP.NET. I have a mailhandler class which encapsulates all the mail operations.

The problem is in the code below.

Visual Basic:
    Public Function SendTEstCDOMail()
        Dim om As New CDO.Message()
        Dim Flds As ADODB.Fields
        Flds = om.Configuration.Fields

        With Flds
            .Item(cdoSendUsingMethod) = cdoSendUsingPort
            .Item(cdoSMTPServerName) = "localhost"
            .Item(cdoSMTPConnectionTimeout) = 10 ' quick timeout
            .Update()
        End With
        om.From = "d1200199@qub.ac.uk"
        om.To = "d1200199@qub.ac.uk"
        om.Subject = "hello"
        om.TextBody = "anything"

        om.Fields.Update()
        om.Send()
    End Function

when I am wring the I get errors that the Name 'cdoSendUsingMethod' is not declared. and
Name 'cdoSendUsingPort' is not declared
and
Name 'cdoSMTPServerName' is not declared.
and
Name 'cdoSMTPConnectionTimeout' is not declared.


I have referenced CDOSYS in my projec tbut I canot understand why these are not being refernced correctly.

Any ideas?

Cheers

Peter
 
Did you ever get an answer to this? I am having the same problem as I try to move an existing VB6 application to VB.Net.

Thanks.
 
Back
Top