0

I am about to start writing a program that will have a GUI interface with the user that prompts for a number between 1-100. The program then emails me that number(this program would be running on an unknown users computer).

I am unable to decide what programing language to use for such a project. Can anyone suggest a language that is able to do GUI, and send emails from someone elses computer? (Preferable be able to save this program as a .exe or some single file that can be run from their computer. Also would prefer a link as to how to email in that language, but I am fine doing that research myself, just unsure what language to start researching in. If I left anything out please leave a comment asking for clarification. Thanks for any help I can get.

Tom Harrington
  • 69,312
  • 10
  • 146
  • 170
Lain
  • 2,166
  • 4
  • 23
  • 47

1 Answers1

1

Use C# cus you know it's awesome (heavily biased answer) and here's the code

  private bool sendMsg (string from, string to, string subject , string messageBody)
    {
         MailMessage message = null;
         try
         {
            message = new MailMessage(from, to);
            using (message)  {
            message.Subject = subject;
            //message.CC.Add(CCemailAddress);
            message.Body = messageBody;
            message.IsBodyHtml = false;
            SmtpClient client = new SmtpClient("smtp.outlook.com", 587);
            client.Credentials = new System.Net.NetworkCredential(from, "Sending Accounts Password");
            client.UseDefaultCredentials = false;
            client.DeliveryMethod = SmtpDeliveryMethod.Network;
            client.EnableSsl = true; //enable SSL
            client.Send(message);
            client.Dispose();
         }
        }
        catch 
        {
            return false;
        }
         message.Dispose();
         return true;
    }
fuzzybear
  • 2,325
  • 3
  • 23
  • 45