• How do I bypass Outlook & use an IP addr for SMTP (2003)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » How do I bypass Outlook & use an IP addr for SMTP (2003)

    Author
    Topic
    #433541

    I need to bypass our default Outlook and use our SMTP IP address. Is there a
    way to set the IP address for our SMTP server so the SendObject will use that
    address and not the default.

    Viewing 1 reply thread
    Author
    Replies
    • #1020033
      • #1020036

        Thank you Hans

      • #1020063

        Hans,
        I’m having trouble understanding how to connect to CDO. When I run the code I get the attached error. Under MS/Access I’m not sure what I need to define FLDS as.

        ‘ Send by connecting to port 25 of the SMTP server.
        Dim iMsg
        Dim iConf
        Dim Flds
        Dim strHTML
        Const cdoSendUsingPort = 25
        set iMsg = CreateObject(“CDO.Message”)
        set iConf = CreateObject(“CDO.Configuration”)
        Set Flds = iConf.Fields
        ‘ Set the CDOSYS configuration fields to use port 25 on the SMTP server.
        With Flds
        .Item(“http://schemas.microsoft.com/cdo/configuration/sendusing”) = cdoSendUsingPort
        .Item(“http://schemas.microsoft.com/cdo/configuration/smtpserver”) = “”
        .Item(“http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout”) = 10
        .Update ‘ <==== Error is here
        End With
        ‘ Build HTML for message body.
        strHTML = “”
        strHTML = strHTML & “”
        strHTML = strHTML & “”
        strHTML = strHTML & “ This is the test HTML message body
        strHTML = strHTML & “”
        strHTML = strHTML & “”
        ‘ Apply the settings to the message.
        With iMsg
        Set .Configuration = iConf
        .To = “” ‘ToDo: Enter a valid email address.
        .From = “” ‘ToDo: Enter a valid email address.
        .Subject = “This is a test CDOSYS message (Sent via Port 25)”
        .HTMLBody = strHTML
        .Send
        End With

        ‘ Clean up variables.
        Set iMsg = Nothing
        Set iConf = Nothing
        Set Flds = Nothing

        MsgBox “Mail Sent!”

        Within Access i created a module and have changed the following

        Dim iMsg As CDO.Message
        Dim iConf As CDO.Configuration
        Dim Flds As ???????? ‘<======Now sure what to do here
        Dim strHTML As String

        confused
        Edited a mail id.

        • #1020065

          Flds should be a Variant, so you can use

          Dim Flds As Variant

          or

          Dim Flds

          since Variant is the default variable type. Try removing the from the IP address:

          .Item(“http://schemas.microsoft.com/cdo/configuration/smtpserver&#8221;) = “nn.nn.nn.nn”

          • #1020067

            Could it be that I ned another reference. I’m still getting the error
            ‘Fields update failed. For further information, examine the Status property of individual field objects.’
            on the .UPDATE. It’s as if i don’t have updating available to me. I did find an example where ADODB.Fields was used but when I use it ,update is not available.

            • #1020071

              You need to set a reference to the Microsoft CDO n Library (n = 1.21 on my PC) or to the Microsoft CDO for Exchange n Library (n = version of Exchange you use).

              I’m sorry, I don’t know anything about CDO, so I can’t really help you with this.

            • #1020075

              Thanks for your help Hans.

              I’m using ‘Microsoft CDO for Windows 2000 Library’.

              I’ll look to see if there is a newer version that I need to use.

    • #1022005

      (Edited by HansV to make URL clickable – see Help 19)

      You might look at jmail http://www.dimac.net[/url%5D
      It makes it really easy to send e-mail without the hassle of mapi controls or other cumbersome means.

      • #1024040

        Thanks Mike.

        Sorry I didn’t get back sooner but I’ve been on vacation.

    Viewing 1 reply thread
    Reply To: How do I bypass Outlook & use an IP addr for SMTP (2003)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: