Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Will NT7 support SendMail thru SSL?

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

    Will NT7 support SendMail thru SSL?

    It's clear from search through the forums that NT 6.5 SendMail does not support SSL.

    However, most ISPs have not only required SSL to log into their own e-mail addresses (for example AT&T) but they also filter out port 25 so that we can't connect to external SMTP hosts. So, supporting SSL for SendMail is critical, if you want to send alerts or alert customers, etc.

    Will NT 7 support this?

    Thanks in advance,

    Ken

    #2
    Ken,

    NT7 does support SSL and changing away from port 25.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by kjackson View Post
      It's clear from search through the forums that NT 6.5 SendMail does not support SSL.
      If you need to use it in NT6.5 then just write the code below. You may find in the internet details and more samples. Just open an account on Google and use it's credentials in the code below:

      PHP Code:
       
      using System;
      using System.ComponentModel;
       
       
      .........BlaBlaBla.........
       
      public static void SendGoogleEmail(string msgSubject, string msgText)
      {
       try
       {
        string strID = "[email protected]"; 
        string strPassword = "yourpassword"; 
        string strEmailAddress = " [email protected] "; 
        string strEmailTo = "[email protected]";
       
        MailMessage mM = new MailMessage();
        mM.From = new MailAddress(strEmailAddress);
        mM.To.Add(strEmailTo);
        mM.Subject = msgSubject;
        mM.Body = msgText;
        mM.IsBodyHtml = false;
        mM.Priority = MailPriority.High;
        SmtpClient sC = new SmtpClient("smtp.gmail.com");
        sC.Port = 587;
        sC.Credentials = new NetworkCredential(strID, strPassword);
        sC.EnableSsl = true;
        sC.SendAsync(mM, "Token1");
       }
       catch (Exception exc)
       {
          Log.Error(string.Format("Error sending google email"), exc);
       }
      } 
      
      Last edited by dimkdimk; 01-21-2010, 06:12 AM.

      Comment


        #4
        Where would you insert this code below to make it all work?

        Comment


          #5
          Originally posted by saj816 View Post
          Where would you insert this code below to make it all work?

          This is global public static method. So answer to your question is: Add it to any class. In NT Help you can find description of writing UserDefined methods in the UserDefined...cs files. You can place this method there.
          For example if you add this method to Indicator class then you can use it anywhere in the code like Indicator.SendGoogleEmail(....)

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by charlesugo_1, 05-26-2026, 05:03 PM
          0 responses
          55 views
          0 likes
          Last Post charlesugo_1  
          Started by DannyP96, 05-18-2026, 02:38 PM
          1 response
          142 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by CarlTrading, 05-11-2026, 05:56 AM
          0 responses
          160 views
          0 likes
          Last Post CarlTrading  
          Started by CarlTrading, 05-10-2026, 08:12 PM
          0 responses
          96 views
          0 likes
          Last Post CarlTrading  
          Started by Hwop38, 05-04-2026, 07:02 PM
          0 responses
          276 views
          0 likes
          Last Post Hwop38
          by Hwop38
           
          Working...
          X