Net::SMTPAuthenticationError (530 5.7.0 Must issue a STARTTLS command first.

2,809 views
Skip to first unread message

pzupan

unread,
Jul 15, 2010, 2:35:31 PM7/15/10
to Spree
I'm getting the above error when trying to send email from Spree.
We're using Gmail and have installed the action_mailer_optional_tls
plugin

ruby 1.8.7, rails 2.3.8, host is Dreamhost

/config/environments/production.rb

ActionMailer::Base.smtp_settings = {
:tls => true,
:address => "smtp.gmail.com",
:port => "587",
:domain => "www.v...s.com",
:authentication => :plain,
:user_name => "info@v...s.com",
:password => "password"
}

I have the same domain, user_name and other settings in Spree::Config.

I've tested the domain, user_name and password, and have another rails
2.2.2 app running sending mail on same server. However, still unable
to get past the above error. Is there a better fix for STARTTLS in
Spree?

Thanks,
Paul

Jarret Luft

unread,
Jul 15, 2010, 3:25:27 PM7/15/10
to spree...@googlegroups.com
Hi Paul,
I believe rails 2.3 has tls support right in it, so you shouldn't need a plugin to accomplish this.

I have used :enable_starttls_auto => true
as one of my arguments in the past, which has corrected the error you are seeing.  I was using gmail as well.  You may want to take out your :tls => true line and try the above instead.

Also, i'm not sure the www in front of your domain is necessary. i just use domain.com.  (whether that makes any difference, I don't know).

Hope that at least points you in the right direction with your problem.
-Jarret.

Reference forum conversation:
http://railsforum.com/viewtopic.php?id=28480


--
You received this message because you are subscribed to the Google Groups "Spree" group.
To post to this group, send email to spree...@googlegroups.com.
To unsubscribe from this group, send email to spree-user+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/spree-user?hl=en.


Mike

unread,
Jul 15, 2010, 4:13:45 PM7/15/10
to Spree
Paul,

In my apps (including my Spree app), I follow this:
http://drawohara.com/post/37908300/rails-using-ssl-tls-with-actionmailer-gmail

It works perfectly.

Mike

On Jul 15, 3:25 pm, Jarret Luft <jarret.l...@gmail.com> wrote:
> Hi Paul,
> I believe rails 2.3 has tls support right in it, so you shouldn't need a
> plugin to accomplish this.
>
> I have used *:enable_starttls_auto => true*
> as one of my arguments in the past, which has corrected the error you are
> seeing.  I was using gmail as well.  You may want to take out your* :tls =>
> true* line and try the above instead.
> > spree-user+...@googlegroups.com<spree-user%2Bunsu...@googlegroups.com>
> > .

pzupan

unread,
Jul 15, 2010, 6:23:32 PM7/15/10
to Spree
Thanks for all the help.

After trying both of the above, and still getting the same error, I
finally traced it to the Spree Mail Server Settings.

After setting the connection type to TLS, email began working.

Simply go to the Mail Server Settings in Spree Admin and set:

Secure Connection Type: TLS

It seems ActionMailer has STARTTLS built in so no plugins or other
settings were necessary.

Paul

Roman Smirnov

unread,
Jul 21, 2010, 3:13:59 PM7/21/10
to Spree
All what you need for perfect work Spree with Gmail - configure your
mail settings via admin panel:
https://demo.spreecommerce.com/admin/mail_settings/edit

Secure Connection Type should be TLS for GMail
SMTP Authentication Type should be plain for GMail

Sunil Gowda

unread,
Apr 17, 2013, 11:31:50 PM4/17/13
to spree...@googlegroups.com
I have noticed that you need to restart the server to pick up any changes made via the admin UI. Just put a breakpoint in mail_settings.rb (in the init method) and it's hit only during a start. The admin UI should probably have a note explicitly stating that the server should be restarted.
Reply all
Reply to author
Forward
0 new messages