# Cannot get tlsmail working; Want Gmail as SMTP

**URL:** <https://www.ruby-forum.com/t/cannot-get-tlsmail-working-want-gmail-as-smtp/155083>\
**Category:** Rails\
**Created:** [December 7, 2008, 6:18pm UTC](https://www.ruby-forum.com/t/cannot-get-tlsmail-working-want-gmail-as-smtp/155083 "2008-12-07T18:18:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![yetanothergeek](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/8e8cbc/32.png) [@yetanothergeek](https://www.ruby-forum.com/u/yetanothergeek)\
**Post date:** [December 7, 2008, 6:18pm UTC](https://www.ruby-forum.com/t/cannot-get-tlsmail-working-want-gmail-as-smtp/155083/1 "2008-12-07T18:18:01Z")

</div>

This is killing me, folks. I have reviewed numerous examples and tried  
two different approaches to try and use Gmail (Google Apps account) as  
my application’s SMTP. Every time, both on my slicehost server and local  
dev machine (both Ubuntu Linux), my logs show no errors and I see a copy  
of the mail in my logs. Yet I never received a test email. I’ve tried  
both the action\_mailer\_tls plugin and the tlsmail gem. Both give the  
same results. I prefer to get tlsmail working. Here are the tlsmail  
settings, at the end of my environment.rb, that I’m using:

require ‘tlsmail’  
Net::SMTP.enable\_tls(OpenSSL::SSL::VERIFY\_NONE)

ActionMailer::Base.raise\_delivery\_errors = true  
ActionMailer::Base.perform\_deliveries = true  
ActionMailer::Base.delivery\_method = :smtp  
ActionMailer::Base.smtp\_settings = {  
:address =\> ‘[smtp.gmail.com](http://smtp.gmail.com)’,  
:port =\> 587,  
:tls =\> true,  
:domain =\> ‘[my google apps domain]’,  
:authentication =\> :plain,  
:user\_name =\> ‘[google apps login]’,  
:password =\> ‘[password]’  
}

With this setup I’m trying to use Gmail as my SMTP in both dev &  
production mode with full logging.

I’m assuming there is a problem with my app connecting to the SMTP  
server. How can I debug this? I’d like to trace the app’s connection to  
the SMTP server.

Is there a specific port I need open on my end to make the transaction  
successful?

Any help with debugging would be greatly appreciated. Thank you.

---

<div class="post-metadata">

**Author:** ![yetanothergeek](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/8e8cbc/32.png) [@yetanothergeek](https://www.ruby-forum.com/u/yetanothergeek)\
**Post date:** [December 7, 2008, 7:34pm UTC](https://www.ruby-forum.com/t/cannot-get-tlsmail-working-want-gmail-as-smtp/155083/2 "2008-12-07T19:34:39Z")

</div>

Nevermind, it’s working. I just wasn’t looking in the right places.

---

<div class="post-metadata">

**Author:** ![yetanothergeek](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/8e8cbc/32.png) [@yetanothergeek](https://www.ruby-forum.com/u/yetanothergeek)\
**Post date:** [January 3, 2009, 5:41pm UTC](https://www.ruby-forum.com/t/cannot-get-tlsmail-working-want-gmail-as-smtp/155083/3 "2009-01-03T17:41:55Z")

</div>

Chris S. wrote:

> Nevermind, it’s working. I just wasn’t looking in the right places.

Hi,

I think I have the same problem, could you describe what helped?  
Thanks.

---

<div class="post-metadata">

**Author:** ![yetanothergeek](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/8e8cbc/32.png) [@yetanothergeek](https://www.ruby-forum.com/u/yetanothergeek)\
**Post date:** [January 3, 2009, 6:04pm UTC](https://www.ruby-forum.com/t/cannot-get-tlsmail-working-want-gmail-as-smtp/155083/4 "2009-01-03T18:04:57Z")

</div>

Peter Frosta wrote:

> Chris S. wrote:
> 
> > Nevermind, it’s working. I just wasn’t looking in the right places.
> 
> Hi,
> 
> I think I have the same problem, could you describe what helped?  
> Thanks.

Nevermind, it’s working now 🙂
