+ Reply to Thread
Results 1 to 7 of 7

Error send mail with CDO

  1. #1
    JKing
    Guest

    Error send mail with CDO

    Hy:

    When i try to send email with this code i get a error "the message could not be sent to the smtp server"
    Run-time error 2147220975 (80040211) The transport error code was 0x80040217
    Software in use Microsoft Excel 2003 and windows xp.

    Windows 2000 and office 2000 configuration no problems.

    Thanks
    Paulo



    Private Sub EnvEmailControl()


    Dim iMsg As Object
    Dim iConf As Object
    Dim WB As Workbook
    Dim WBname As String

    Application.ScreenUpdating = False
    Set WB = ActiveWorkbook
    WBname = WB.Name
    WB.SaveCopyAs "C:\" & WBname
    Set iMsg = CreateObject("CDO.Message")
    Set iConf = CreateObject("CDO.Configuration")
    With iMsg
    Set .Configuration = iConf
    .To = "sample@test.com"
    .From = """Anyone"" <xxxx>"
    .Subject = Range("L3").Value
    .TextBody = "book"
    .AddAttachment "C:\" & WBname
    .Send ' error on this comand

    End With
    Set iMsg = Nothing
    Set iConf = Nothing
    Set WB = Nothing
    Application.ScreenUpdating = False


    End Sub

  2. #2
    K Dales
    Guest

    RE: Error send mail with CDO

    No, not in the same way. Excel can only keep the "live" link between two
    open books if they are open by the same user on the same workstation. You
    could, of course (if allowed) open the 2nd workbook in shared mode and update
    it frequently. Other than that Excel will only be able to read what is in
    the saved file, not the open workbook on the other machine.
    --
    - K Dales


    "JKing" wrote:

    > Hy:
    >
    > When i try to send email with this code i get a error "the message could not be sent to the smtp server"
    > Run-time error 2147220975 (80040211) The transport error code was 0x80040217
    > Software in use Microsoft Excel 2003 and windows xp.
    >
    > Windows 2000 and office 2000 configuration no problems.
    >
    > Thanks
    > Paulo
    >
    >
    >
    > Private Sub EnvEmailControl()
    >
    >
    > Dim iMsg As Object
    > Dim iConf As Object
    > Dim WB As Workbook
    > Dim WBname As String
    >
    > Application.ScreenUpdating = False
    > Set WB = ActiveWorkbook
    > WBname = WB.Name
    > WB.SaveCopyAs "C:\" & WBname
    > Set iMsg = CreateObject("CDO.Message")
    > Set iConf = CreateObject("CDO.Configuration")
    > With iMsg
    > Set .Configuration = iConf
    > .To = "sample@test.com"
    > .From = """Anyone"" <xxxx>"
    > .Subject = Range("L3").Value
    > .TextBody = "book"
    > .AddAttachment "C:\" & WBname
    > .Send ' error on this comand
    >
    > End With
    > Set iMsg = Nothing
    > Set iConf = Nothing
    > Set WB = Nothing
    > Application.ScreenUpdating = False
    >
    >
    > End Sub


  3. #3
    Jean-Yves
    Guest

    Re: Error send mail with CDO

    Hi,

    Do you configure iConf, ie SMTP server and port number ?

    Regards
    JY

    "JKing" <JKing@yahoo.es> wrote in message
    news:%230NtnRH9FHA.1332@tk2msftngp13.phx.gbl...
    Hy:

    When i try to send email with this code i get a error "the message could not
    be sent to the smtp server"
    Run-time error 2147220975 (80040211) The transport error code was 0x80040217
    Software in use Microsoft Excel 2003 and windows xp.

    Windows 2000 and office 2000 configuration no problems.

    Thanks
    Paulo



    Private Sub EnvEmailControl()


    Dim iMsg As Object
    Dim iConf As Object
    Dim WB As Workbook
    Dim WBname As String

    Application.ScreenUpdating = False
    Set WB = ActiveWorkbook
    WBname = WB.Name
    WB.SaveCopyAs "C:\" & WBname
    Set iMsg = CreateObject("CDO.Message")
    Set iConf = CreateObject("CDO.Configuration")
    With iMsg
    Set .Configuration = iConf
    .To = "sample@test.com"
    .From = """Anyone"" <xxxx>"
    .Subject = Range("L3").Value
    .TextBody = "book"
    .AddAttachment "C:\" & WBname
    .Send ' error on this comand

    End With
    Set iMsg = Nothing
    Set iConf = Nothing
    Set WB = Nothing
    Application.ScreenUpdating = False


    End Sub



  4. #4
    Ron de Bruin
    Guest

    Re: Error send mail with CDO

    Hi JKing

    Read the text above the code examples please
    http://www.rondebruin.nl/cdo.htm

    --
    Regards Ron de Bruin
    http://www.rondebruin.nl


    "JKing" <JKing@yahoo.es> wrote in message news:%230NtnRH9FHA.1332@tk2msftngp13.phx.gbl...
    Hy:

    When i try to send email with this code i get a error "the message could not be sent to the smtp server"
    Run-time error 2147220975 (80040211) The transport error code was 0x80040217
    Software in use Microsoft Excel 2003 and windows xp.

    Windows 2000 and office 2000 configuration no problems.

    Thanks
    Paulo



    Private Sub EnvEmailControl()


    Dim iMsg As Object
    Dim iConf As Object
    Dim WB As Workbook
    Dim WBname As String

    Application.ScreenUpdating = False
    Set WB = ActiveWorkbook
    WBname = WB.Name
    WB.SaveCopyAs "C:\" & WBname
    Set iMsg = CreateObject("CDO.Message")
    Set iConf = CreateObject("CDO.Configuration")
    With iMsg
    Set .Configuration = iConf
    .To = "sample@test.com"
    .From = """Anyone"" <xxxx>"
    .Subject = Range("L3").Value
    .TextBody = "book"
    .AddAttachment "C:\" & WBname
    .Send ' error on this comand

    End With
    Set iMsg = Nothing
    Set iConf = Nothing
    Set WB = Nothing
    Application.ScreenUpdating = False


    End Sub

  5. #5
    JKing
    Guest

    Re: Error send mail with CDO

    Hi

    No Jean i dont know configure iConf, SMTP server and port number.
    If you give me some help?
    This macro is a Ron de Bruin sample with adaptations, dont work in excel 2003 or windows Xp

    Thanks Jean
    Thanks Ron de Bruin

    Regards
    Paulo Coelho
    ..
    "Ron de Bruin" <rondebruin@kabelfoon.nl> wrote in message news:eTcIdmP9FHA.1844@TK2MSFTNGP11.phx.gbl...
    Hi JKing

    Read the text above the code examples please
    http://www.rondebruin.nl/cdo.htm

    --
    Regards Ron de Bruin
    http://www.rondebruin.nl


    "JKing" <JKing@yahoo.es> wrote in message news:%230NtnRH9FHA.1332@tk2msftngp13.phx.gbl...
    Hy:

    When i try to send email with this code i get a error "the message could not be sent to the smtp server"
    Run-time error 2147220975 (80040211) The transport error code was 0x80040217
    Software in use Microsoft Excel 2003 and windows xp.

    Windows 2000 and office 2000 configuration no problems.

    Thanks
    Paulo



    Private Sub EnvEmailControl()


    Dim iMsg As Object
    Dim iConf As Object
    Dim WB As Workbook
    Dim WBname As String

    Application.ScreenUpdating = False
    Set WB = ActiveWorkbook
    WBname = WB.Name
    WB.SaveCopyAs "C:\" & WBname
    Set iMsg = CreateObject("CDO.Message")
    Set iConf = CreateObject("CDO.Configuration")
    With iMsg
    Set .Configuration = iConf
    .To = "sample@test.com"
    .From = """Anyone"" <xxxx>"
    .Subject = Range("L3").Value
    .TextBody = "book"
    .AddAttachment "C:\" & WBname
    .Send ' error on this comand

    End With
    Set iMsg = Nothing
    Set iConf = Nothing
    Set WB = Nothing
    Application.ScreenUpdating = False


    End Sub

  6. #6
    Jean-Yves
    Guest

    Re: Error send mail with CDO

    Hi,

    Take Ron advice and read his web page.
    The answer is written there. You just need the name of the SMTP server to
    adapt the code
    which is on Ron's page.

    Regards

    Jean-Yves
    "JKing" <JKing@yahoo.es> wrote in message
    news:eURsoRQ9FHA.3492@TK2MSFTNGP10.phx.gbl...
    Hi

    No Jean i dont know configure iConf, SMTP server and port number.
    If you give me some help?
    This macro is a Ron de Bruin sample with adaptations, dont work in excel
    2003 or windows Xp

    Thanks Jean
    Thanks Ron de Bruin

    Regards
    Paulo Coelho
    ..
    "Ron de Bruin" <rondebruin@kabelfoon.nl> wrote in message
    news:eTcIdmP9FHA.1844@TK2MSFTNGP11.phx.gbl...
    Hi JKing

    Read the text above the code examples please
    http://www.rondebruin.nl/cdo.htm

    --
    Regards Ron de Bruin
    http://www.rondebruin.nl


    "JKing" <JKing@yahoo.es> wrote in message
    news:%230NtnRH9FHA.1332@tk2msftngp13.phx.gbl...
    Hy:

    When i try to send email with this code i get a error "the message could not
    be sent to the smtp server"
    Run-time error 2147220975 (80040211) The transport error code was 0x80040217
    Software in use Microsoft Excel 2003 and windows xp.

    Windows 2000 and office 2000 configuration no problems.

    Thanks
    Paulo



    Private Sub EnvEmailControl()


    Dim iMsg As Object
    Dim iConf As Object
    Dim WB As Workbook
    Dim WBname As String

    Application.ScreenUpdating = False
    Set WB = ActiveWorkbook
    WBname = WB.Name
    WB.SaveCopyAs "C:\" & WBname
    Set iMsg = CreateObject("CDO.Message")
    Set iConf = CreateObject("CDO.Configuration")
    With iMsg
    Set .Configuration = iConf
    .To = "sample@test.com"
    .From = """Anyone"" <xxxx>"
    .Subject = Range("L3").Value
    .TextBody = "book"
    .AddAttachment "C:\" & WBname
    .Send ' error on this comand

    End With
    Set iMsg = Nothing
    Set iConf = Nothing
    Set WB = Nothing
    Application.ScreenUpdating = False


    End Sub



  7. #7
    JKing
    Guest

    Re: Error send mail with CDO


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1