CDO.Message

Discussion in 'ASP General' started by Paul, Jan 25, 2005.

  1. Paul

    Paul Guest

    I am using CDO.Message object with code below. When I execute the .Send
    command, I get the following error.

    Error: -2147220973
    Description: The transport failed to connect to the server.

    Note: The SMTP Server and the IIS Server are the same machine.

    Anyone come across this error message in the past? This error also occurs
    when I use Method #1 where I use the schema reference provided by Microsoft.

    Here is the code:

    <!--
    METADATA
    TYPE="typelib"
    UUID="CD000000-8B95-11D1-82DB-00C04FB1625D"
    NAME="CDO for Windows 2000 Library"
    -->

    <%
    'METHOD #2
    Set cdoConfig = CreateObject("CDO.Configuration")

    With cdoConfig.Fields
    .Item(cdoSendUsingMethod) = cdoSendUsingPort
    .Item(cdoSMTPServer) = "10.60.19.24"
    .Item(cdoSMTPServerPort) = "25"
    .Update
    End With

    Set cdoMessage = CreateObject("CDO.Message")

    With cdoMessage
    Set .Configuration = cdoConfig
    .From = ""
    .To = ""
    .Subject = "Sample CDO Message"
    .TextBody = "This is a test for CDO.message"
    .Send
    End With

    Set cdoMessage = Nothing
    Set cdoConfig = Nothing
     
    Paul, Jan 25, 2005
    #1
    1. Advertising

  2. Paul

    Dr. Know Guest

    Paul said:

    >I am using CDO.Message object with code below. When I execute the .Send
    >command, I get the following error.
    >
    >Error: -2147220973
    >Description: The transport failed to connect to the server.


    This is a Server Not Found error. CDOSYS is not recognizing the
    server name as supplied.

    Also, using the cdoSendUsingPort method, you may have to provide
    authentication credentials - unless you're running an open relay mail
    server - (please say you're not...)

    >Note: The SMTP Server and the IIS Server are the same machine.
    > .Item(cdoSendUsingMethod) = cdoSendUsingPort


    If they are on the same machine, you should probably skip the
    cdoSendUsingPort and use the drop directory instead.

    > .Item(cdoSMTPServer) = "10.60.19.24"
    > .Item(cdoSMTPServerPort) = "25"


    I'm don't believe this is the correct connection string for the
    SMTPServer name and see above note. Also make sure you're SMTP server
    is using port 25. (It IS the default.)

    Try the NetBios computer name instead of the ip address.
    With NO slashes - i.e.

    ComputerServer1

    It should work.

    FWIW,
    Greg







    Dr. Know
     
    Dr. Know, Jan 25, 2005
    #2
    1. Advertising

  3. Paul

    Dr. Know Guest

    Dr. Know said:

    >I'm don't believe this is the correct connection string for the
    >SMTPServer name and see above note. Also make sure you're SMTP server
    >is using port 25. (It IS the default.)


    Nix that first statement - I'm a moron today...

    An IP address is allowable, but you probably will have to provide an
    authenticated machine user account and password - like this:

    With mobjFlds
    .Item(cdoSendUsingMethod) = cdoSendUsingPort
    .Item(cdoSMTPConnectionTimeout) = 60
    .Item(cdoSMTPAuthenticate) = cdoBasic
    .Item(cdoSMTPServer) = "ComputerServer1" OR "192.168.0.1"
    .Item(cdoSMTPServerPort) = 25
    .Item(cdoSendUserName) = "someuser"
    .Item(cdoSendPassword) = "somepassword"
    .Update <----
    End With


    Greg








    Dr. Know
     
    Dr. Know, Jan 25, 2005
    #3
  4. Paul

    Dr. Know Guest

    Paul said:

    > .Item(cdoSMTPServer) = "10.60.19.24"
    > .Item(cdoSMTPServerPort) = "25"


    I'm a double idiot today...

    The port number should be a number, not a string.


    25, not "25"


    Greg


    Dr. Know
     
    Dr. Know, Jan 25, 2005
    #4
  5. Paul

    Steven Burn Guest

    Third time lucky ;o) ([sarcasm] how about "Dr 'except when I'm an idiot' Know" ?? <vbg> [/sarcasm])

    --

    Regards

    Steven Burn
    Ur I.T. Mate Group
    www.it-mate.co.uk

    Keeping it FREE!

    "Dr. Know" <> wrote in message news:...
    | Paul said:
    |
    | > .Item(cdoSMTPServer) = "10.60.19.24"
    | > .Item(cdoSMTPServerPort) = "25"
    |
    | I'm a double idiot today...
    |
    | The port number should be a number, not a string.
    |
    |
    | 25, not "25"
    |
    |
    | Greg
    |
    |
    | Dr. Know
     
    Steven Burn, Jan 25, 2005
    #5
  6. Paul

    Dr. Know Guest

    Steven Burn said:

    >Third time lucky ;o) ([sarcasm] how about "Dr 'except when I'm an idiot' Know" ?? <vbg> [/sarcasm])


    What can I say, it's a left-over nym, I'm too lazy to change it. :-\

    I've got a VBA, an InterDev, a newsreader, a MMC console to a local
    server, and a TV window open...
    It's amazing I can keep *any* thoughts marshalled... Wanker. ;-)
    <vbg>


    Greg






    Dr. Know
     
    Dr. Know, Jan 25, 2005
    #6
  7. Paul

    Steven Burn Guest

    ;o)

    --

    Regards

    Steven Burn
    Ur I.T. Mate Group
    www.it-mate.co.uk

    Keeping it FREE!

    "Dr. Know" <> wrote in message news:...
    | Steven Burn said:
    |
    | >Third time lucky ;o) ([sarcasm] how about "Dr 'except when I'm an idiot' Know" ?? <vbg> [/sarcasm])
    |
    | What can I say, it's a left-over nym, I'm too lazy to change it. :-\
    |
    | I've got a VBA, an InterDev, a newsreader, a MMC console to a local
    | server, and a TV window open...
    | It's amazing I can keep *any* thoughts marshalled... Wanker. ;-)
    | <vbg>
    |
    |
    | Greg
    |
    |
    |
    |
    |
    |
    | Dr. Know
     
    Steven Burn, Jan 25, 2005
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Anthony Fine
    Replies:
    3
    Views:
    3,262
    Jure Spik
    Feb 12, 2004
  2. Cyndia A.
    Replies:
    0
    Views:
    657
    Cyndia A.
    Jan 14, 2004
  3. Lars-Erik Aabech

    Could not access 'CDO.Message' object

    Lars-Erik Aabech, Mar 3, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    2,842
    Henrik_the_boss
    Mar 4, 2004
  4. Guest
    Replies:
    2
    Views:
    958
    dave wanta
    Jul 11, 2003
  5. Replies:
    0
    Views:
    316
Loading...

Share This Page