Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Unable to send mail from a script. Test email works.

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

    Unable to send mail from a script. Test email works.

    Hi. I created an indicator to send me an email alert when a price threshold is exceeded.

    The interactive "Test Mail" option under the [Misc] tab does work. Using the following line, alone in a script does not work:

    SendMail("my_account@my_asp.com", "[email protected]", "Trade Alert", "Buy ES");

    I even used Wireshark in order to troubleshoot. I see nothing going through the wire when I press F5. I see the entire conversation going ok with the smtp server when I do the test mentionned above.

    I even added the Log() command to make sure something was happening. The script works. It's like the scripting engine won't spit out the order to send mail. How do I troubleshoot this?

    mp

    #2
    Hello marcusplexus,

    If there is a problem sending an email, it should show up inside of your Trace file located in (My) Documents -> NinjaTrader 7 -> trace folder.

    If you would like for me to take a look you may send me your log and trace files for today so that I may look into what occurred.

    You can do this by going to the Control Center-> Help-> Mail to Support.

    Please reference the following ticket number in the body of the email: ATTN: JC with reference to this thread.

    Note that SendMail() will also only work when running on Real-Time Data, so if the condition that is true when if (Historical) is true will not produce an email but it will still Print.




    JCNinjaTrader Customer Service

    Comment


      #3
      Ok. Back in the days you would get flooded by emails with older bars hitting the threshold. The live feed connection was the issue. Thanks.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      157 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      91 views
      1 like
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      143 views
      2 likes
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      131 views
      1 like
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      107 views
      0 likes
      Last Post CarlTrading  
      Working...
      X