Code
using System;
using Microsoft.Office.Interop.Outlook;
namespace GMService {
class Program {
static void Main() {
Application app = new Application();
NameSpace ns = app.GetNamespace("mapi");
ns.Logon("jim", "password", false, true);
MailItem message = (MailItem) app.CreateItem(OlItemType.olMailItem);
message.To = "some_man@hotmail.com";
message.Subject = "A simple test message";
message.Body = "This is a test. It should work";
message.Send();
ns.Logoff();
Console.Read();
}
}
}
using System;
using Microsoft.Office.Interop.Outlook;
namespace GMService {
class Program {
static void Main() {
Application app = new Application();
NameSpace ns = app.GetNamespace("mapi");
ns.Logon("jim", "password", false, true);
MailItem message = (MailItem) app.CreateItem(OlItemType.olMailItem);
message.To = "some_man@hotmail.com";
message.Subject = "A simple test message";
message.Body = "This is a test. It should work";
message.Send();
ns.Logoff();
Console.Read();
}
}
}