SMTPAuthenticationError

Ho un grosso problema con l’invio delle mail!
L’errore che mi spunta è:
Net::SMTPAuthenticationError in Manda mailController#create_order

530 5.7.0 Must issue a STARTTLS command first. d8sm2155075fga.25

Per la configurazione in enviroment ho usato

config.action_mailer.delivery_method = :smtp
config.action_mailer.perform_deliveries = true
config.action_mailer.raise_delivery_errors = true
config.action_mailer.smtp_settings = {
:address => “smtp.gmail.com”,
:port => 587,
:authentication => :plain,
:user_name => “[email protected]”,
:password => “miapass”,
}
config.action_mailer.default_charset = “utf-8”

Nel mailer ho il seguente metodo:
class Mailer < ActionMailer::Base
def confirm(order)
subject ‘Conferma prenotazione pizze’
recipients order.email
from ‘[email protected]
sent_on Time.now
body :order => order
end
end

Per quanto riguarda il controller:

class MandaMailController < ApplicationController
def create_order
order = Order.find(params[:id])
email = Mailer.create_confirm(order)
#email.set_content_type(“text/html” )
Mailer.deliver_confirm(order)
render(:text => “

” + email.encoded + “
” )
end
end

Uso ruby 1.8.7, per le gemme 1.3.1 non chiedetemi di aggiornarle :slight_smile:
Grazie a tutti in anticipo!

Ciao,

devi attivare l’uso del TLS con
:enable_starttls_auto => true

io uso:
ActionMailer::Base.smtp_settings = {
:address => “smtp.gmail.com”,
:port => 587,
:authentication => :plain,
:enable_starttls_auto => true,
:user_name => ‘[email protected]’,
:password => ‘mia_passwd’
}

Ciao,
FEj

On Sat, Mar 20, 2010 at 11:14 AM, Alex S. [email protected]
wrote:

config.action_mailer.smtp_settings = {
def confirm(order)
class MandaMailController < ApplicationController
Grazie a tutti in anticipo!

Posted via http://www.ruby-forum.com/.


Ml mailing list
[email protected]
http://lists.ruby-it.org/mailman/listinfo/ml


Emilio Frusciante

“Go and spread the free software. Happy hacking!” - RMS

FEj wrote:

Ciao,

devi attivare l’uso del TLS con
:enable_starttls_auto => true

io uso:
ActionMailer::Base.smtp_settings = {
:address => “smtp.gmail.com”,
:port => 587,
:authentication => :plain,
:enable_starttls_auto => true,
:user_name => ‘[email protected]’,
:password => ‘mia_passwd’
}

Ciao,
FEj

Purtroppo continua a darmi lo stesso errore. Per l’esattezza mi dice:

/usr/lib/ruby/1.8/net/smtp.rb:948:in check_auth_continue' /usr/lib/ruby/1.8/net/smtp.rb:740:inauth_login’
/usr/lib/ruby/1.8/net/smtp.rb:921:in critical' /usr/lib/ruby/1.8/net/smtp.rb:739:inauth_login’
/usr/lib/ruby/1.8/net/smtp.rb:725:in send' /usr/lib/ruby/1.8/net/smtp.rb:725:inauthenticate’
/usr/lib/ruby/1.8/net/smtp.rb:566:in do_start' /usr/lib/ruby/1.8/net/smtp.rb:525:instart’
/usr/lib/ruby/1.8/net/smtp.rb:463:in start' vendor/rails/actionmailer/lib/action_mailer/base.rb:627:inperform_delivery_smtp’
vendor/rails/actionmailer/lib/action_mailer/base.rb:508:in __send__' vendor/rails/actionmailer/lib/action_mailer/base.rb:508:indeliver!’
vendor/rails/actionmailer/lib/action_mailer/base.rb:383:in
method_missing' app/controllers/manda_mail_controller.rb:7:increate_order’

Installata la gemma action_mailer_tls. niente da fare anche ora!
Comunque uso la 2.1.0

Ciao,

che versione di rails stai usando?

Installa il la gemma action_mailer_tls

Ciao,
FEj

On Sat, Mar 20, 2010 at 1:25 PM, Alex S. [email protected]
wrote:

:authentication => :plain,

`perform_delivery_smtp’
[email protected]
http://lists.ruby-it.org/mailman/listinfo/ml


Emilio Frusciante

“Go and spread the free software. Happy hacking!” - RMS

Problema risolto! da quello che ho capito il problema è gmail. Non
bastano le impostazioni classiche!
Cmq grazie a tutti!

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs