Aspose.Email.Examples.CSharp.Email.SMTP.SendEmailViaProxyServer.Run C# (CSharp) Method

Run() public static method

public static Run ( ) : void
return void
        public static void Run()
        {
            // ExStart:SendEmailViaProxyServer
            SmtpClient client = new SmtpClient("smtp.domain.com", "username", "password");
            client.SecurityOptions = SecurityOptions.SSLImplicit;
            string proxyAddress = "192.168.203.142"; // proxy address
            int proxyPort = 1080; // proxy port
            SocksProxy proxy = new SocksProxy(proxyAddress, proxyPort, SocksVersion.SocksV5);
            client.SocksProxy = proxy;
            client.Send(new MailMessage("[email protected]", "[email protected]", "Sending Email via proxy", "Implement socks proxy protocol for versions 4, 4a, 5 (only Username/Password authentication)"));
            // ExEnd:SendEmailViaProxyServer
        }
    }
SendEmailViaProxyServer