Esempio n. 1
0
        static void Main(string[] args)
        {
            SmtpHost host = new SmtpHost()
            {
                Host = "smtp.somesite.com",
                Port = 25
            };

            SmtpLogin credentials = new SmtpLogin()
            {
                Username = "******",
                Password = "******"
            };

            using (SmtpSocket auth = new SmtpSocket(host))
            {
                auth.Connect();
                if (auth.Authenticate(credentials))
                {
                    Console.WriteLine("Logged in");
                }
                else
                {
                    Console.WriteLine("Failed");
                }
            }

            Console.WriteLine(" == Program Executed == ");

            Console.ReadLine();
        }
Esempio n. 2
0
 public SmtpSocket(SmtpHost smtp)
 {
     this.smtp   = smtp;
     this.socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
 }