Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Email error "failed to send email" Sender address must include domain?!!!

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

    Email error "failed to send email" Sender address must include domain?!!!

    I have several strategies running with email alerts. One of the strtegies does not issue alerts even though the code is identical to strategies which are issuing alerts. Message is:

    Email error 501 <NT>"failed to send email" Sender address must include domain?!!!

    What gives?

    #2
    Hello ninjablanks,

    From the message it looks like you are missing the domain (@ninjatrader.com portion). Do you have the snippet available that is used to send mail we can check.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Snippet

      SendMail("", "[email protected]", "", "exit")

      Comment


        #4
        Sender is the From indicated in the method signature below. You can use your own email address, and define settings in Tools > Options > Misc tab.
        SendMail(string from, string to, string subject, string text)
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          Is there a way to read the email address that's stored in the "misc tab" from within a ninjascript?

          I'm looking to only require the user to setup their email properties in the NT settings and my ninjascript will be able to handle sending emails automatically to this established address.

          Thanks!

          Comment


            #6
            On a related subject. I setup my email settings, performed a "test" email that was successful, but when I call SendEmail() from my ninjascript. Here is an example of the call I'm doing (I have the same email address setup in the NT setup:

            SendMail("[email protected]", "[email protected]", "Test Subject", "This is the body");

            I don't get a success nor an error message in the log tab when this is called.

            Daniel

            Comment


              #7
              Hi neoikon,

              There's unfortunately not a supported property you can read from to get a user's email address.

              The main thing to keep in mind with SendMail() is that it's ignored if called on historical data. If you call it on a real time tick and it fails, there should be a message in the log tab then.
              Ryan M.NinjaTrader Customer Service

              Comment


                #8
                Originally posted by NinjaTrader_RyanM View Post
                The main thing to keep in mind with SendMail() is that it's ignored if called on historical data. If you call it on a real time tick and it fails, there should be a message in the log tab then.
                Yeah, I read that. What do you mean by "historical data"? Meaning "on bar close" set to true?

                I'm currently testing the functionality on a 45 min chart.

                Comment


                  #9
                  Historical bars are all bars that exist prior to enabling the script. Real-time bars(or updates) are all updates that come in after the script is enabled. You can have real time updates with CalculateOnBarClose = true.

                  If you're on a 45 minute chart with COBC = true, the first real time update will come when one of these bars is closed after enabling the script.

                  It may be easier to verify real time functionality with SendMail() by working with a smaller interval chart like 1 minute.
                  Ryan M.NinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                  0 responses
                  650 views
                  0 likes
                  Last Post Geovanny Suaza  
                  Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                  0 responses
                  370 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by Mindset, 02-09-2026, 11:44 AM
                  0 responses
                  109 views
                  0 likes
                  Last Post Mindset
                  by Mindset
                   
                  Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                  0 responses
                  574 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by RFrosty, 01-28-2026, 06:49 PM
                  0 responses
                  577 views
                  1 like
                  Last Post RFrosty
                  by RFrosty
                   
                  Working...
                  X