Ragaei
Ragaei

Reputation: 123

C# : how can i switch between my two network interface

can i switch between my two network cards,i need to use on card to send mails so i need to switch control to it.si there a way to do this by c# code? any help will be appreciated

Upvotes: 2

Views: 445

Answers (1)

Greg Hewgill
Greg Hewgill

Reputation: 992897

When sending email, you will make an outgoing connection to port 25 on an SMTP server. When you make the connection, you need to bind the local end of the connection to a specific IP address (corresponding to a specific interface) before connecting in order to force the OS to use a specific interface. See the Socket.Bind method for a way to do this.

Upvotes: 1

Related Questions