Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to send a text message...

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

    How to send a text message...

    ...anyone know if we can send a text message to a phone when certain conditions are met through NT. This may be more of a C# question however I used to be a Java guy so I am not familiar with the nuances of C# and if there is a class available to do something like this. Thanks!

    #2
    I am unaware of any .NET class specific to sending text messages.
    RayNinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Ray View Post
      I am unaware of any .NET class specific to sending text messages.
      Actually I think I found my solution, I am still reading through the info and setting it up but it's as simple as emailing your cell. For instance if you have verizon you send an email to ##########@vtext.com and that's it!

      Comment


        #4
        It's as simple as the following however for some reason System.Web.Mail is not available....hmmmmm....more research as I know very little about C# (is pretty similar to Java though).

        using System.Web.Mail;

        ...

        MailMessage mail = new MailMessage();
        mail.To = "[email protected]";
        mail.From = "Your Automated Trader";
        mail.Subject = "";
        mail.Body = "Some message!";
        SmtpMail.SmtpServer = "localhost";
        SmtpMail.Send(mail);


        ----EDIT--- The above works for .NET framework 1.1 the following works for 2.0 and up... (notice the change in the using statement too)

        using System.Net.Mail;

        MailMessage mail = new MailMessage();
        mail.To.Add("[email protected]");
        mail.From =
        new MailAddress("Your Automated Trader");
        mail.Subject =
        "";
        mail.Body =
        "blah!";
        SmtpClient smtp =
        new SmtpClient("127.0.0.1");
        smtp.Send(mail);
        Last edited by fxRichard; 06-10-2008, 02:16 PM.

        Comment


          #5
          Ok this works...

          Okay this is what ended up working for me using GMail...

          using System.Net;
          using System.Net.Mail;

          MailMessage mail = new MailMessage();
          mail.To.Add("[email protected]");
          mail.From =
          new MailAddress("your return mail address");
          mail.Subject =
          "";
          mail.Body =
          "some message here";
          SmtpClient smtp =
          new SmtpClient("smtp.gmail.com",587);
          smtp.EnableSsl =
          true;
          smtp.Credentials =
          new NetworkCredential("username","password");
          smtp.Send(mail);

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by jonfan45, Today, 06:06 PM
          0 responses
          8 views
          0 likes
          Last Post jonfan45  
          Started by rustyspring, Today, 05:15 PM
          0 responses
          9 views
          0 likes
          Last Post rustyspring  
          Started by xulu13, Today, 05:01 PM
          0 responses
          12 views
          0 likes
          Last Post xulu13
          by xulu13
           
          Started by Pbarrionuevo, Today, 04:30 PM
          0 responses
          9 views
          0 likes
          Last Post Pbarrionuevo  
          Started by vantojo, Today, 01:39 PM
          0 responses
          20 views
          0 likes
          Last Post vantojo
          by vantojo
           
          Working...
          X