Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

SendMail Problems

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

    SendMail Problems

    Now, I have done this before and for some reason the very same code does not work in an indicator while it's working in a strategy:

    Code:
    SendMail(from, recipient.Email, subject, message);
    Print("from: " + from);
    Print("recipient: " + recipient.Email);
    Print("subject: " + subject);
    Print("message: " + message);
    No errors in my log or in my trace. Here's are the print statements:

    from: [email protected]
    recipient: [email protected]
    subject: Alert
    message: This is a test

    Now, I did test the connection via the Options-Misc tab and it's sending me test messages just fine. Also, again - the same code works in several strategies.

    I'm stumped...

    Molecool

    #2
    Hello,

    I take it the Print() function is working, it is just not sending the mail?


    What settings are you using from Tools > Options > Misc tab? If you tell me who you email provider is, I can give you some specific settings to try here that might help.
    MatthewNinjaTrader Product Management

    Comment


      #3
      Matthew - I am using my own server - not some ISP. But what I have tried to point out already is that the very same NT setup is sending out emails just fine from several of my strategies. This is the first time I'm trying it in an Indicator and for some reason the email never arrives. Which is why I'm so puzzled about this. There is nothing in the logs, nothing in the trace, etc. The email seems to be properly formatted, so I'm starting to think it may be NT7.0.1000.6 - does that build have any pertinent problems?

      Comment


        #4
        Hello,

        I'm not aware of any issues with SendMail() in the prior release. If it is working on other strategies, it would likely not be an issue with the method itself or anything else in NinjaTrader.

        If you create a test strategy using only this snippet of code, does it work as expected?
        MatthewNinjaTrader Product Management

        Comment


          #5
          In summary..

          If BaseIndicator.SendMail() does not work and BaseStrategy.SendMail() works with the same call on the very same NT installation then I'm lead to believe that there's something wrong with BaseIndicator's SendMail method. Obviously the test emails arrive properly too. Plus there are no error message whatsoever anywhere.

          Any help would be greatly appreciated.

          Molecool

          Comment


            #6
            Hello Molecool,

            To clarify, you said you have other stratigies which can use SendMail() without issues? Or do you have issues on all of your strategies.

            Just to be sure, please upgrade to NT V7.0.1000.7 and test again.


            If you see further issues, please send us an email to support[at]ninjatrader[dot]com and include a simplified version of your script which exhibits this behavior. Please also include 'attn: matthew' and a reference to this thread.
            MatthewNinjaTrader Product Management

            Comment


              #7
              Okay, one more time ;-)

              All my strategies are sending emails just fine.
              On the same system.
              Running the same instance of NT7.
              Only my (very simple) indicator calls the SendMail method but nothing comes out the other end.
              No error messages, no error logs, no error traces.
              The test email function is working fine as well.
              The ONLY thing that does not work is sending emails from my Indicator. And obviously the call is being made as I already shared my print statements in my first message. Should be very simple stuff - it's just not happening.

              Is that clear now?

              Comment


                #8
                Wait a minute...

                Does SendMail still only work on live data? I remember that being the case sometime back in 2008. I actually always had a 'isHistorical' condition in my method which I commented out to test the email function after hours.

                Well, it's late night in CA and I'll run the indicator tomorrow morning on live data to see if it's sending out that email.

                Comment


                  #9
                  Hello,

                  Please see below:



                  * Calls to this method are ignored on historical data, it will only work in real-time.

                  Comment


                    #10
                    Thanks - it worked fine in live tape this morning. Appreciate the help.

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by helpwanted, Today, 03:06 AM
                    1 response
                    7 views
                    0 likes
                    Last Post sarafuenonly123  
                    Started by Brevo, Today, 01:45 AM
                    0 responses
                    7 views
                    0 likes
                    Last Post Brevo
                    by Brevo
                     
                    Started by aussugardefender, Today, 01:07 AM
                    0 responses
                    5 views
                    0 likes
                    Last Post aussugardefender  
                    Started by pvincent, 06-23-2022, 12:53 PM
                    14 responses
                    242 views
                    0 likes
                    Last Post Nyman
                    by Nyman
                     
                    Started by TraderG23, 12-08-2023, 07:56 AM
                    9 responses
                    385 views
                    1 like
                    Last Post Gavini
                    by Gavini
                     
                    Working...
                    X