• 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 Issues

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

    sendmail Issues

    HI, I can't get sendmail() to work, I get this error "Failed to send mail: System.Net.Mail.SmtpException: Failure sending mail. ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond"

    Test email does work.

    Thanks.

    #2
    It is now working, but sending emails non stop.

    Comment


      #3
      Hello bougie,

      Can you confirm that when you did the test email that you received the email that will be tittle "NinjaTrader test mail" in the subject line and inside the body it will state "This is a test mail"?

      Also, do you have any firewalls, antivirus, or other scanning software installed on your computer? If so, could you try disabling it and trying it again.
      JCNinjaTrader Customer Service

      Comment


        #4
        Hello bougie,

        Glad to hear that it is working.

        It may be due to the conditions where you are calling the SendMail() function. Could you post a snippet of code on the conditions you are calling the SendMail() and what you have Calculate on Bar close set to?

        http://www.ninjatrader.com/support/h...onbarclose.htm
        JCNinjaTrader Customer Service

        Comment


          #5
          if(CrossAbove( RSI(14, 3),30,1) || CrossBelow(RSI(14, 3),70,1))
          Alert(
          "myAlert", NinjaTrader.Cbi.Priority.High, "RSI Alert", "Alert3.wav", 10, Color.Black, Color.Yellow);

          SendMail(
          "[email protected]", "[email protected]", "Instrument.FullName", "RSI has crossed limit");


          and just added this below the above code

          {
          // Calculate on the close of each bar
          CalculateOnBarClose = true;
          }
          Last edited by bougie; 10-12-2012, 08:41 AM.

          Comment


            #6
            Hello bougie,

            Code:
            if(CrossAbove( RSI(14, 3),30,1) || CrossBelow(RSI(14, 3),70,1))
            Alert("myAlert", NinjaTrader.Cbi.Priority.High, "RSI Alert", "Alert3.wav", 10, Color.Black, Color.Yellow);
            
            SendMail("[email protected]", "[email protected]", "Instrument.FullName", "RSI has crossed limit");
            It is going to repeatidly call the SendMail() method because there is a ";" at the end of your Alert() marking then end of it so your SendMail() is being called on every OnBarUpdate. You may change it to the following:

            Code:
            if(CrossAbove( RSI(14, 3),30,1) || CrossBelow(RSI(14, 3),70,1))
            {
            Alert("myAlert", NinjaTrader.Cbi.Priority.High, "RSI Alert", "Alert3.wav", 10, Color.Black, Color.Yellow);
            SendMail("[email protected]", "[email protected]", "Instrument.FullName", "RSI has crossed limit");
            }
            Last edited by NinjaTrader_JC; 10-12-2012, 09:34 AM.
            JCNinjaTrader Customer Service

            Comment


              #7
              hi, I copied and pasted the code, now getting errors.

              Click image for larger version

Name:	nt err4.jpg
Views:	1
Size:	98.1 KB
ID:	866201

              Comment


                #8
                Hello bougie,

                I appoligize I put the cureley brace in the wrong posiiton. You may try this revised code:

                Code:
                if(CrossAbove( RSI(14, 3),30,1) || CrossBelow(RSI(14, 3),70,1))
                {
                Alert("myAlert", NinjaTrader.Cbi.Priority.High, "RSI Alert", "Alert3.wav", 10, Color.Black, Color.Yellow);
                SendMail("[email protected]", "[email protected]", "Instrument.FullName", "RSI has crossed limit");
                }
                JCNinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by GMiller64, Today, 05:56 PM
                0 responses
                1 view
                0 likes
                Last Post GMiller64  
                Started by rickyblah12, Today, 05:01 PM
                1 response
                3 views
                0 likes
                Last Post NinjaTrader_ShawnB  
                Started by jtrading82, 10-11-2019, 05:07 PM
                8 responses
                80 views
                1 like
                Last Post sledge
                by sledge
                 
                Started by MARTIN MARTIN, Yesterday, 01:01 PM
                3 responses
                41 views
                0 likes
                Last Post MARTIN MARTIN  
                Started by NickyD, Today, 11:42 AM
                1 response
                10 views
                0 likes
                Last Post NinjaTrader_Jim  
                Working...
                X