Forum

You are not logged in.

#1 31-05-2012 16:39:20

coorasse
Membre
Registered: 31-05-2012
Posts: 16

Problem configuring SMTP with Rails 3.1.0 and gmail

Hi all,
I just installed my Rails app in alwaysdata.
I can't figure out how to set up smtp server for ActionMailer.
That configuration works perfectly on my local machine and opn Heroku but not here where I obtain the following error:

Net::SMTPAuthenticationError (535-5.7.1 Please log in with your web browser and then try again. Learn more at
535 5.7.1 https://support.google.com/mail/bin/ans … swer=78754 z8sm7237817wiy.1
):

show my production.rb configuration file:
config.action_mailer.delivery_method = :smtp
config.action_mailer.perform_deliveries = true
config.action_mailer.raise_delivery_errors = true
config.action_mailer.default_url_options = { :host => 'coorasse.alwaysdata.net' }

require 'tlsmail'
Net::SMTP.enable_tls(OpenSSL::SSL::VERIFY_NONE)

ActionMailer::Base.delivery_method = :smtp
ActionMailer::Base.perform_deliveries = true
ActionMailer::Base.raise_delivery_errors = true
ActionMailer::Base.smtp_settings = {
  :enable_starttls_auto => true,
  :address            => 'smtp.gmail.com',
  :port               => 587,
  :domain             => 'gmail.com',
  :authentication     => :plain,
  :user_name          => 'coorasse@gmail.com',
  :password           => 'SECRET'
}

someone with the same problem, here?

Thanks,
Alessandro R

Offline

#2 31-05-2012 16:51:46

@Cyril
Staff
From: Paris
Registered: 06-02-2007
Posts: 5,583
Website

Re: Problem configuring SMTP with Rails 3.1.0 and gmail

Hello,

What SMTP server do you use?

Offline

#3 31-05-2012 19:10:49

Fitted
Membre
Registered: 31-05-2012
Posts: 3

Re: Problem configuring SMTP with Rails 3.1.0 and gmail

hello I'm new to this, I'm trying to send emails using this valid email address  "program@yerevantv.am" but I either get a delivery failure message or the message simply would not be sent to the recipient email. what are we supposed to do? 

what I did was:
first I went here
https://webmail.alwaysdata.com

logged in with the above mentioned email and then clicked on compose a new message, added the recipient  email, the subject and the content of the message, then clicked send now, got a notification in green saying message sent successfully but it was not.

Last edited by Fitted (31-05-2012 21:42:28)

Offline

#4 01-06-2012 07:46:48

coorasse
Membre
Registered: 31-05-2012
Posts: 16

Re: Problem configuring SMTP with Rails 3.1.0 and gmail

Fitted wrote:

hello I'm new to this, I'm trying to send emails using this valid email address  "program@yerevantv.am" but I either get a delivery failure message or the message simply would not be sent to the recipient email. what are we supposed to do? 

what I did was:
...

please open another topic

Offline

#5 01-06-2012 07:47:56

coorasse
Membre
Registered: 31-05-2012
Posts: 16

Re: Problem configuring SMTP with Rails 3.1.0 and gmail

Cyril wrote:

Hello,

What SMTP server do you use?

I'm using smtp.gmail.com on port 587

Offline

#6 01-06-2012 10:06:23

@Cyril
Staff
From: Paris
Registered: 06-02-2007
Posts: 5,583
Website

Re: Problem configuring SMTP with Rails 3.1.0 and gmail

Well, it's a Gmail error message, I can't really tell you what's wrong. We don't block anything, as you can see since you can contact Gmail's SMTP server.

Offline

#7 01-06-2012 11:26:58

coorasse
Membre
Registered: 31-05-2012
Posts: 16

Re: Problem configuring SMTP with Rails 3.1.0 and gmail

Cyril wrote:

Well, it's a Gmail error message, I can't really tell you what's wrong. We don't block anything, as you can see since you can contact Gmail's SMTP server.

Ok: I write here so it can be useful for someone else in future:
I created a new Gmail account without the option "two step verification" and it works correctly.
I can't understand why it doesn't work with the "2 steps" and the provided password.
I will ask Google Team for that and post here the solution.
Thanks,
Alessandro

Offline

#8 24-01-2014 15:15:49

Manuite
Membre
From: Annecy
Registered: 27-05-2010
Posts: 113
Website

Re: Problem configuring SMTP with Rails 3.1.0 and gmail

With the two step verif you need to create a password per-app (any app, doesn't matter) that you can then use. For example, my youtube app stopped working on my iphone after doing the two-step thing (sounds like a dance move ;-) so I created a password (named youtubeiphone so I remember what it's for) and logged in with it and hurray!

Offline

#9 27-09-2017 07:21:35

grovalmitch
Invité

Re: Problem configuring SMTP with Rails 3.1.0 and gmail

It is because Google blocks sign-in attempts from apps which do not use modern security standards (mentioned on their support page). You can however, turn on/off this safety feature by going to the link below:

Go to this link and select Turn On

https://www.google.com/settings/security/lesssecureapps

more on....smtp email

Board footer

Powered by FluxBB