Topic: actionmailer / gmail / rails 2.3.2

Has anyone been able to get actionmailer working with gmail under rails 2.3.2?

In 2.2.2 you needed to have a tls plugin, however my plug-in now does not work with 2.3.2. If I take out the plug-in I get the error:

530 5.7.0 Must issue a STARTTLS command first. h2sm5768861fkh.29

cheers
Michael

Michael

Get more visibility of your IT environment with www.itdashboard.co.uk

Re: actionmailer / gmail / rails 2.3.2

Uhm, i've upgraded my application that use gmail and tls plugin to rails 2.3.2 and everything continued to work fine...

Re: actionmailer / gmail / rails 2.3.2

Which tls plugin are you using?

Michael

Get more visibility of your IT environment with www.itdashboard.co.uk

Re: actionmailer / gmail / rails 2.3.2

Actually I have binned using the plugins and am now making use of the native tls functionality. Simply add the following line to your smtp settings

:enable_starttls_auto => true,

works a treat. Hurrah!

Michael

Get more visibility of your IT environment with www.itdashboard.co.uk

Re: actionmailer / gmail / rails 2.3.2

mole1066 wrote:

Actually I have binned using the plugins and am now making use of the native tls functionality. Simply add the following line to your smtp settings

:enable_starttls_auto => true,

works a treat. Hurrah!

Can you please list your settings as I have no smtp-tls plugins installed and am running on rails 2.3.2 + ruby 1.8.7 and I still get the error:

530 5.7.0 Must issue a STARTTLS command first. b4sm670946tic.10

My settings are:

config.action_mailer.smtp_settings = {
  :address        => 'smtp.gmail.com',
  :port           => 587,
  :domain         => 'somedomain.com',
  :authentication => :login,
  :user_name      => 'my_name@somedomain.com',
  :password       => 'secret'
}

I have not set :enable_starttls_auto => true because the RDoc for actionmailer-2.3.2 states that:

:enable_starttls_auto - When set to true, detects if STARTTLS is enabled in your SMTP server and starts to use it. It works only on Ruby >= 1.8.7 and Ruby >= 1.9. Default is true.

I am begging for help for this one. You are the third person I have seen that has made the same claim, that rails 2.3.2 can utilise the tls functionality without plugins.

Re: actionmailer / gmail / rails 2.3.2

ActionMailer::Base.smtp_settings = {
  :enable_starttls_auto => true,
  :address => 'smtp.gmail.com',
  :port => 587,
  :domain => 'yourgmailappdomain.com',
  :authentication => :plain,
  :user_name => 'gmaillogin',
  :password => 'password'
}

Michael

Get more visibility of your IT environment with www.itdashboard.co.uk

Re: actionmailer / gmail / rails 2.3.2

mole1066 wrote:

ActionMailer::Base.smtp_settings = {
  :enable_starttls_auto => true,
  :address => 'smtp.gmail.com',
  :port => 587,
  :domain => 'yourgmailappdomain.com',
  :authentication => :plain,
  :user_name => 'gmaillogin',
  :password => 'password'
}

Thank you so much! Works great!

I am running no smtp tls type plug-ins, rails 2.3.2, and also ruby 1.8.7

Re: actionmailer / gmail / rails 2.3.2

Hi, where is this being defined?  I have rails 2.3.2 but there isn't an actionmailer.rb file, I am using restful_authentcation and want to use their UserMailer

Re: actionmailer / gmail / rails 2.3.2

angelacode wrote:

Hi, where is this being defined?  I have rails 2.3.2 but there isn't an actionmailer.rb file, I am using restful_authentcation and want to use their UserMailer

I have put the below code under config/environments/development.rb and it works fine. You could put it in config/environments.rb though:

# these options are only needed if you choose smtp delivery
config.action_mailer.smtp_settings = {
    :enable_starttls_auto => true,
    :address        => 'smtp.gmail.com',
    :port           => 587,
    :domain         => 'yourdomain.com.au',
    :authentication => :plain,
    :user_name      => 'info@yourdomain.com.au',
    :password       => 'your_password'
}

Re: actionmailer / gmail / rails 2.3.2

thanks...I am running it locally to test it on my development box but I'm not seeing any email being sent...but I don't get an error, either.  Grrr...can you help me please?

Where should I look to best debug this?

Re: actionmailer / gmail / rails 2.3.2

angelacode wrote:

Where should I look to best debug this?

Is there anything in your log files?
You should see your email being generated word for word in your log files prefixed by

Sent mail to your.email@your.domain.com

Also, what versions of rails and ruby are you on?

Re: actionmailer / gmail / rails 2.3.2

Just so that I'm not totally crazy, I do check my Rails Console and it displays that emails are being sent using the action mailer configuration....just no real emails sad

Re: actionmailer / gmail / rails 2.3.2

Yep, when I look at the logs generated in the Console, it shows

Sent mail to

I believe I am on Rails 2.3.2 and Ruby 1.8.6 ...

Re: actionmailer / gmail / rails 2.3.2

Is there anything else I need to use to activate my ActionMailer class?  I've put the code as above in environments/development.rb....

It is definitely going through the variables set in my mailers....

Thanks, oh I hope you can help me...so close!

Re: actionmailer / gmail / rails 2.3.2

You need Ruby 1.8.7 to use the STARTTLS parameter used for TLS smtp requests.

https://rails.lighthouseapp.com/project … s-gmail-go

Try upgrading your Ruby to this version.

Otherwise you will need to install the actionmailer tls plugin if you want to remain on Ruby 1.8.6

Last edited by obiwanchinobi (2009-04-28 23:18:15)

Re: actionmailer / gmail / rails 2.3.2

ahah!  thank you....hmmm...I don't know what will break if I go to Ruby 1.8.7....seems like people are on 2.3.2 rails and fine....what do you think??

Re: actionmailer / gmail / rails 2.3.2

hmmm...the one-click installer only seems to have 1.8.6...I think that means I need the tls plugin....is this sufficient?

http://agilewebdevelopment.com/plugins/actionmailer_tls

Re: actionmailer / gmail / rails 2.3.2

I encountered the exact same issue as you come to think of it. I was on Ruby 1.8.6 and Rails 2.3.2 so I upgraded Ruby because I didn't want to install a plugin for something that was fixed, trialled, and used in later versions.

Re: actionmailer / gmail / rails 2.3.2

oh, okay, maybe I'll try that, I just installed the plugin for action_mailer_tls and nothing's changed....I guess I should do the dive but there isn't like a one-click install for ruby and ruby can't be updated from the console....how did you upgrade to 1.8.7?

Re: actionmailer / gmail / rails 2.3.2

http://www.ruby-lang.org/en/downloads/