Bonjour,
J'ai un souci avec l'envoi de mail.
Voici la trace :
c:/ruby/lib/ruby/1.8/net/smtp.rb:680:in `check_response'
c:/ruby/lib/ruby/1.8/net/smtp.rb:593:in `auth_cram_md5'
c:/ruby/lib/ruby/1.8/net/smtp.rb:686:in `critical'
c:/ruby/lib/ruby/1.8/net/smtp.rb:592:in `auth_cram_md5'
c:/ruby/lib/ruby/1.8/net/smtp.rb:571:in `__send__'
c:/ruby/lib/ruby/1.8/net/smtp.rb:571:in `authenticate'
c:/ruby/lib/ruby/1.8/net/smtp.rb:411:in `do_start'
c:/ruby/lib/ruby/1.8/net/smtp.rb:378:in `start'
c:/ruby/lib/ruby/1.8/net/smtp.rb:316:in `start'
c:/ruby/lib/ruby/gems/1.8/gems/actionmailer-1.2.5/lib/action_mailer/base.rb:511:in `perform_delivery_smtp'
c:/ruby/lib/ruby/gems/1.8/gems/actionmailer-1.2.5/lib/action_mailer/base.rb:397:in `send'
c:/ruby/lib/ruby/gems/1.8/gems/actionmailer-1.2.5/lib/action_mailer/base.rb:397:in `deliver!'
c:/ruby/lib/ruby/gems/1.8/gems/actionmailer-1.2.5/lib/action_mailer/base.rb:291:in `method_missing'
#{RAILS_ROOT}/app/controllers/user_controller.rb:34:in `create'
-e:4:in `load'
-e:4
Dans environment.rb :
ActionMailer::Base.delivery_method = :smtp
ActionMailer::Base.server_settings = {
:address => "mail.monsite.com",
:port => 25,
:domain => "www.monsite.com",
:authentification => :login,
:user_name => "monuser",
:password => "monpassword"
}
ActionMailer::Base.raise_delivery_errors = true
Ma classe permettant l'envoi de mail (Notifier) :
class Notifier < ActionMailer::Base
def send_mail(user, subject, content)
@recipients = user.email
@from = "support@monsite.com"
@subject = subject
# Email body
@body["texte"] = content
end
end
La vue (send_mail.rhtml) :
MON TEXTE
Le controleur :
def create
user = User.new(params[:user])
Notifier::deliver_send_mail(user,"Creation de votre compte", "Votre compte a ete cree")
end
|
il y a 18 heures 54 min
il y a 2 jours 11 heures
il y a 5 jours 13 heures
il y a 5 jours 13 heures
il y a 5 jours 18 heures
il y a 5 jours 19 heures
il y a 6 jours 14 heures
il y a 1 semaine 14 heures
il y a 1 semaine 18 heures
il y a 1 semaine 5 jours