# SMTP gmail, behind proxy?

**URL:** <https://www.ruby-forum.com/t/smtp-gmail-behind-proxy/131402>\
**Category:** Ruby\
**Created:** [March 9, 2008, 12:57pm UTC](https://www.ruby-forum.com/t/smtp-gmail-behind-proxy/131402 "2008-03-09T12:57:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![marlor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/90ced4/32.png) [@marlor](https://www.ruby-forum.com/u/marlor)\
**Post date:** [March 9, 2008, 12:57pm UTC](https://www.ruby-forum.com/t/smtp-gmail-behind-proxy/131402/1 "2008-03-09T12:57:51Z")

</div>

Hello,

I got the action\_mailer\_tls plugin to work with gmail. (without being  
behind a proxy).

My problem is that I have to connect to gmail’s smtp from behind a  
proxy.  
I looked into the SMTP and mailer\_tls plugin but couldn’t find a way to  
set the proxy like in http HTTP::Proxy(…, …).  
Google also didn’t help in this case ☹

## After installing mailer\_tls, the below code works without being behind a proxy:

ActionMailer::Base.delivery\_method = :smtp

```
    mmessage = <<END_OF_MESSAGE

```

From: theName \<#{MAIL\_SENDER}\>  
To: #{mail\_to.join("; ")}  
Subject: #{subject}

#{message.strip}  
END\_OF\_MESSAGE

```
    Net::SMTP.start(MAIL_SMTP, MAIL_PORT, MAIL_DOMAIN,
        MAIL_SENDER, MAIL_PASSWORD, :login) do |smtp|
        smtp.send_message mmessage,
            MAIL_SENDER,
            mail_to
    end

```

* * *

Any suggestion is appriciated.

Thanks
