Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

SendMail not working as Text message via email

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

    SendMail not working as Text message via email

    Hello.

    I'm trying to create a strategy that will send me a text message alert via email. Unfortunately, the SendMail() function does not seem to be working.

    I have the following code:
    if (cond1)
    {
    Print("RBuD ("+Convert.ToString(Time[0])+")");
    SendMail("9********[email protected]", "RBuD ("+Convert.ToString(Time[0])+")", "RBuD");
    }

    When backtesting in the Strategy Analyzer, the print statement works as expected when cond1 is True but the SendMail function doesn't. I also tried SendMail() with a gmail address but it still seems to not work for a regular gmail address or for a text message via email.

    Can anyone help troubleshoot this issue?

    Thanks.

    #2
    Hello rcloutier, thanks for writing in.

    You must set up a Share Service in the options menu to act as the mail server. See here for documentation:

    https://ninjatrader.com/support/help...gShareServices

    Below is a list of common setups for SMTP servers:

    https://ninjatrader.com/support/foru...setups?t=45339

    Please let me know if this does not resolve your inquiry.
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Hi NinjaTrader_ChrisL.

      I confirm that I already have both share services configured. That is clearly not the issue.

      Comment


        #4
        Hello rcloutier, thanks for your reply.

        Are you able to send a text message to this address through a normal email address? The SendMail() method will work if the share service is set up properly. If you can not send a message to a normal email address using SendMail, it implies the share service was not set up correctly. Please try sending a message to a regular email address and test if that works. If not, make sure the share service is set up properly.

        Please let me know if I can assist any further.

        Chris L.NinjaTrader Customer Service

        Comment


          #5
          Hi NinjaTrader_ChrisL.

          Yes, if I send an email from my gmail account to the address ending in @txt.att.net, I receive a text message as expected.

          The regular email share service is setup correctly. I know this because from the setup window on NT8, I clicked on "Send e-mail test" and I received that test email as expected.

          The text message via email share service is also setup correctly. I know this because from my chart, I setup a text message alert that I did receive.

          Everything appears to be working properly except when I try to use the SendMail() function directly from a custom strategy.

          Comment


            #6
            Hello rcloutier, thanks for your reply.

            Can you test out this indicator that I made in the past? It will email the specified email address when an execution occurs on the account:

            https://ninjatraderecosystem.com/use.../email-trades/

            I look forward to hearing of your results.

            The NinjaTrader Ecosystem website is for educational and informational purposes only and should not be considered a solicitation to buy or sell a futures contract or make any other type of investment decision. The add-ons listed on this website are not to be considered a recommendation and it is the reader's responsibility to evaluate any product, service, or company. NinjaTrader Ecosystem LLC is not responsible for the accuracy or content of any product, service or company linked to on this website.
            Chris L.NinjaTrader Customer Service

            Comment


              #7
              Originally posted by rcloutier View Post
              create a strategy that will send me a text message alert via email.

              When backtesting in the Strategy Analyzer, ... the SendMail function doesn't work.
              SendMail only works when State == State.RealTime,
              https://ninjatrader.com/support/help.../?sendmail.htm

              Since Strategy Analyzer uses Historical data only,
              calls to SendMail are ignored while backtesting.

              Comment


                #8
                I actually found the issue with trying to send a text message via email is that the SendMail() function is not what I should have been using. Neither live nor in the strategy analyzer.

                Instead, what I found to work was to first set up the "Text message via email", and then in my strategy to use the Share() function with the first argument set to @"Text message via email". For me, this works as expected.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by rustyspring, Today, 01:31 AM
                0 responses
                4 views
                0 likes
                Last Post rustyspring  
                Started by op1031, Today, 12:26 AM
                0 responses
                7 views
                0 likes
                Last Post op1031
                by op1031
                 
                Started by guenni7, Yesterday, 09:43 PM
                0 responses
                8 views
                0 likes
                Last Post guenni7
                by guenni7
                 
                Started by jonfan45, Yesterday, 06:06 PM
                0 responses
                10 views
                0 likes
                Last Post jonfan45  
                Started by rustyspring, Yesterday, 05:15 PM
                0 responses
                13 views
                0 likes
                Last Post rustyspring  
                Working...
                X