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 <261e6917-d1e9-4779-8f30-97af544e1ed9@VI1PR03MB2928.eurprd03.prod.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 )
    				{	
    					[B]SendMail ("[email protected]", "UNSYNCED ! ", Position.MarketPosition.ToString() + " " + Position.Quantity.ToString()+" StrategyPosition vs AccountPosition " +PositionAccount.Quantity.ToString());[/B]	
    				}
    			   	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.

            Today when i working on one of the case i had to check the mail queue on the servers, suddenly i noticed a mail queue on couple of server, was wondering why the queue is building up. When i investi&#8230;

            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.
                Free online storage and sharing with Screencast.com. 2 GB of storage and 2 GB of bandwidth per month for free. We won't compress, alter or take ownership of your content.


                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.
                  Free online storage and sharing with Screencast.com. 2 GB of storage and 2 GB of bandwidth per month for free. We won't compress, alter or take ownership of your content.


                  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 algospoke, Yesterday, 06:40 PM
                  2 responses
                  19 views
                  0 likes
                  Last Post algospoke  
                  Started by ghoul, Today, 06:02 PM
                  3 responses
                  14 views
                  0 likes
                  Last Post NinjaTrader_Manfred  
                  Started by jeronymite, 04-12-2024, 04:26 PM
                  3 responses
                  45 views
                  0 likes
                  Last Post jeronymite  
                  Started by Barry Milan, Yesterday, 10:35 PM
                  7 responses
                  20 views
                  0 likes
                  Last Post NinjaTrader_Manfred  
                  Started by AttiM, 02-14-2024, 05:20 PM
                  10 responses
                  181 views
                  0 likes
                  Last Post jeronymite  
                  Working...
                  X