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 Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          648 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          369 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          108 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          572 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          574 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X