Forum: Ruby Binding to a local address in Net::SMTP

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Jim Cain (Guest)
on 2006-03-10 08:58
(Received via mailing list)
For TCPSocket, I know it's possible to specify the local IP address if
you want to:

socket =, remote_port, local_addr, local_port)

BTW I found this by looking in the source code, since every document I
was referencing only showed the first two arguments.

I am mailing from a host with multiple IP addresses, and I'd like to
be able to specify the local address when I open a connection with
Net::SMTP. Looking at the source, I don't see any way to do this. I'm
thinking about modifying (1.8.2) or
old_open (1.8.4) so that it calls with the four
arguments, rather than two.

Has anyone had this same issue and created such a workaround? Thanks
for any help.

This topic is locked and can not be replied to.