• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

SendMail() right syntax

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    SendMail() right syntax

    I've been receiving an error message in the log file in regards to emails. The error is this:

    There was an error sending your message: Syntax error, command unrecognized. The server response was: 4.3.2 STOREDRV.ClientSubmit; sender thread limit exceeded <[email protected].outlook.c om> [Hostname=VI1PR03MB2928.eurprd03.prod.outlook.com]

    A few seconds later, the email is sent and received correctly as expected, however, this earlier error annoys me and I'd like to know if there's something wrong with the code that generates it or if it's something related to live.com server. I think that syntax is corrected cause it's just strings but perhaps there's any kind of issue with the size. Here it's:

    Code:
    protected override void OnConnectionStatusUpdate(ConnectionStatusEventArgs connectionStatusUpdate)
    		{
    		  	if( connectionStatusUpdate.Status != ConnectionStatus.Connected || connectionStatusUpdate.PriceStatus != ConnectionStatus.Connected )
    			{
    			   	SendMail ("[email protected]", "DISCONNECTION ! ", "Server failure!, dataserver=0");
    				dataserver=0;
    			}   
    			if( (connectionStatusUpdate.Status == ConnectionStatus.Connected && connectionStatusUpdate.PriceStatus == ConnectionStatus.Connected) && (connectionStatusUpdate.PreviousStatus != ConnectionStatus.Connected || connectionStatusUpdate.PreviousPriceStatus != ConnectionStatus.Connected) )
    			{
    				if ( Position.MarketPosition != PositionAccount.MarketPosition || Position.Quantity != PositionAccount.Quantity )
    				{	
    					SendMail ("[email protected]", "UNSYNCED ! ", Position.MarketPosition.ToString() + " " + Position.Quantity.ToString()+" StrategyPosition vs AccountPosition " +PositionAccount.Quantity.ToString());	
    				}
    			   	dataserver=1;
    			}
    		}
    Thanks in advance
    Last edited by pstrusi; 10-01-2017, 01:35 PM.

    #2
    Originally posted by pstrusi View Post
    I'v
    {
    SendMail ("[email protected]", "UNSYNCED ! ", Position.MarketPosition.ToString() + " " + Position.Quantity.ToString()+" StrategyPosition vs AccountPosition " +PositionAccount.Quantity.ToString());
    }
    dataserver=1;
    }
    }[/CODE]

    Thanks in advance
    You forgot to remove your email from the disconnection SendMail

    Comment


      #3
      Thanks Sledge for the heads up.

      Comment


        #4
        If you search on "4.3.2 STOREDRV.ClientSubmit; sender thread limit exceeded" you will find some information about it.

        Whether or not it makes any sense...

        Are you sure the code is only executing once and not 100 times?

        Comment


          #5
          Thanks for the suggestion.

          Well, I think it's just once cause it's triggered after a connection is recovered which I think that it's detected as one event, but perhaps there's some technicality that I'm missing within this method.

          Comment


            #6
            I found this article with a possible solution, but not quite sure.

            https://vijayjadi.wordpress.com/2012...imit-exceeded/

            Comment


              #7
              Hello pstrusi,

              I will give this a test and look into this further for you.

              I appreciate your patience while I research.
              Chelsea B.NinjaTrader Customer Service

              Comment


                #8
                Hello pstrusi,

                I've tested using the code you have supplied but I was not able to reproduce the errors.

                Below is a link to a short video I recorded while testing.
                https://www.screencast.com/t/UpHpJ8p5

                What version of NinjaTrader 8 are you using? (Help -> About... e.g. 8.0.X.X)

                Attached I have exported the test script so that you may easily import this and test this on your end.
                If you take the exact same steps as taken in the video using the same SMTP server (gmail) are you experiencing different behavior?
                Attached Files
                Chelsea B.NinjaTrader Customer Service

                Comment


                  #9
                  Originally posted by NinjaTrader_ChelseaB View Post
                  Hello pstrusi,

                  I've tested using the code you have supplied but I was not able to reproduce the errors.

                  Below is a link to a short video I recorded while testing.
                  https://www.screencast.com/t/UpHpJ8p5

                  What version of NinjaTrader 8 are you using? (Help -> About... e.g. 8.0.X.X)

                  Attached I have exported the test script so that you may easily import this and test this on your end.
                  If you take the exact same steps as taken in the video using the same SMTP server (gmail) are you experiencing different behavior?

                  Hi Chelsea,

                  Thank you very much for your helpful work addressing this issue.

                  I work with NT8 8.0.9.0 64b

                  Viewing your video, I decided to change the Outgoing server to Gmail and effectively the issue disappeared, so it's obviously something related to Outgoing live.com server, some internal configuration file, I think.

                  Well, thanks again
                  Regards.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by safbrathpro, Today, 05:51 AM
                  0 responses
                  4 views
                  0 likes
                  Last Post safbrathpro  
                  Started by abfefmu, Today, 05:33 AM
                  0 responses
                  4 views
                  0 likes
                  Last Post abfefmu
                  by abfefmu
                   
                  Started by bbdjad, Today, 04:36 AM
                  0 responses
                  4 views
                  0 likes
                  Last Post bbdjad
                  by bbdjad
                   
                  Started by mittie3, Today, 03:33 AM
                  0 responses
                  7 views
                  0 likes
                  Last Post mittie3
                  by mittie3
                   
                  Started by Againmain1, Today, 03:04 AM
                  0 responses
                  8 views
                  0 likes
                  Last Post Againmain1  
                  Working...
                  X