The message could not be sent to the SMTP server. The transport error code was 0x80070057. The server response was not available

  • Hai .....

               I have build a stored procedure that is used to dispatch mails using CDO.Message com object using sp_OACreate method of sql server 2000 with sp3a. I get the following error message when i try to set the port number to the configuration. But the problem vanishes when i comment the port number setting:

    The message could not be sent to the SMTP server. The transport error code was 0x80070057. The server response was not available

    This is code that I have used FYI

    DECLARE @object int

     DECLARE @hr int

     EXEC @hr = sp_OACreate 'CDO.Message', @object OUT

     IF @hr <> 0

         SELECT -1

     EXEC @hr = sp_OASetProperty @object, 'Configuration.fields(".Value','2'">http://schemas.microsoft.com/cdo/configuration/sendusing").Value','2'

     IF @hr <> 0

         SELECT -1

    /* EXEC @hr = sp_OASetProperty @object, 'Configuration.fields(".Value'">http://schemas.microsoft.com/cdo/configuration/smtpserverport").Value', @SMTPServerPort

     IF @hr <> 0

         RETURN NULL

    */

     EXEC @hr = sp_OASetProperty @object, 'Configuration.fields(".Value'">http://schemas.microsoft.com/cdo/configuration/smtpserver").Value', @SMTPServer

     IF @hr <> 0

              SELECT -1

     EXEC @hr = sp_OASetProperty @object, 'Configuration.fields(".Value'">http://schemas.microsoft.com/cdo/configuration/sendusername").Value', @SendUsername

     IF @hr <> 0

              SELECT -1 

    EXEC @hr = sp_OASetProperty @object, 'Configuration.fields(".Value'">http://schemas.microsoft.com/cdo/configuration/sendpassword").Value', @SendPassword

     IF @hr <> 0

              SELECT -1

     

     EXEC @hr = sp_OAMethod @object, 'Configuration.Fields.Update', null

     IF @hr <> 0

              SELECT -1

          SELECT @object

  • This was removed by the editor as SPAM

  • Check the SMTP server. There are security settings concerning 'forwarding'. The SQL Server that you are performing the send from is probably not defined there.

    RegardsRudy KomacsarSenior Database Administrator"Ave Caesar! - Morituri te salutamus."

  • Hai rudy,

                 Can u please reframe your question? I 'm not able to understand what you are trying to say. As far as sending mail is concerned I 'm able to do that from my server. Its just the case when I set the Port number, it gives me the error. Otherwise, everything is working perfectly alright.

                 I set the Port# 25 manually, instead of server opting it by default. So in both case, the same port # is used. When you say security settings concerning 'forwarding', Where does this apply? I 'm new using Sql Server 2000 and what does The SQL Server that you are performing the send from is probably not defined there really means?

  • Well, unless you've got an SMTP server listening on a non-standard port, do you need your code to connect to anything other than port 25? I agree it's one of those things that shouldn't error out, but on the same token, SMTP is tcp/25. That's a given for normal communications.

    K. Brian Kelley
    @kbriankelley

  • Hai Brian,

                I wish on setting the port #25 manually, the mailing should work. If there is anything related to security settings, please let me know so that i do that and make this work.

     

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply