# Use net:smtp behind the proxy

**URL:** <https://www.ruby-forum.com/t/use-net-smtp-behind-the-proxy/195839>\
**Category:** Ruby\
**Created:** [October 1, 2010, 12:13am UTC](https://www.ruby-forum.com/t/use-net-smtp-behind-the-proxy/195839 "2010-10-01T00:13:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![peterk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/7993a0/32.png) [@peterk](https://www.ruby-forum.com/u/peterk)\
**Post date:** [October 1, 2010, 12:13am UTC](https://www.ruby-forum.com/t/use-net-smtp-behind-the-proxy/195839/1 "2010-10-01T00:13:35Z")

</div>

I would like to use net:smtp to send email through [smtp.gmail.com](http://smtp.gmail.com). The  
problem is that I am behind a proxy, so I need to tell the smtp module  
that it should use the proxy (otherwise it wonâ€™t be able to resolve  
[smtp.gmail.com](http://smtp.gmail.com)). How can this be done? There is no obvious way for me to  
specify the proxy. I am using version 1.8.6 of ruby.

---

<div class="post-metadata">

**Author:** ![peterk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/7993a0/32.png) [@peterk](https://www.ruby-forum.com/u/peterk)\
**Post date:** [October 1, 2010, 8:02am UTC](https://www.ruby-forum.com/t/use-net-smtp-behind-the-proxy/195839/2 "2010-10-01T08:02:32Z")

</div>

Peter (Guo) Pei wrote:

> I would like to use net:smtp to send email through [smtp.gmail.com](http://smtp.gmail.com). The  
> problem is that I am behind a proxy, so I need to tell the smtp module  
> that it should use the proxy (otherwise it wonâ€™t be able to resolve  
> [smtp.gmail.com](http://smtp.gmail.com)). How can this be done? There is no obvious way for me to  
> specify the proxy. I am using version 1.8.6 of ruby.

What sort of proxy? SOCKS4/5? Something else?
