Rails Mailboxer - unable to find the recipient domain on sending email via smtp -


i using mailboxer gem in rails application. following 2 methods in user model, messageable -

def name     return :email   end    def mailboxer_email(object)     #check if email should sent object     #if true     # mail(:to => :email, :subject => "your login credential")     return :email     #if false     #return nil   end 

and following smtp settings in development.rb file -

config.action_mailer.default_url_options = { :host => 'localhost:3000' } config.action_mailer.perform_deliveries = true config.action_mailer.raise_delivery_errors = true config.action_mailer.default :charset => "utf-8"  net::smtp.enable_tls(openssl::ssl::verify_none) config.action_mailer.delivery_method = :smtp  actionmailer::base.smtp_settings = { :address => "smtp.gmail.com", :port => 587, :authentication => :plain, :domain => 'gmail.com', :user_name => 'address@gmail.com', :password => 'mypassword', :authentication => 'plain', :enable_starttls_auto => true } 

but on creating message, getting following error -

completed 500 internal server error in 22136ms     net::smtpfatalerror (553-5.1.2 weren't able find recipient domain. please check     553-5.1.2 spelling errors, , make sure didn't enter spaces, periods,     553 5.1.2 or other punctuation after recipient's email address. eg3sm14283691pac.1 - gsmtp     ):    `app/controllers/conversations_controller.rb:12:in `create`' 

i sure sending email proper email address. also, when put debugger in mailboxer_email method, email see valid one.

any idea going wrong?

you getting error:- "we weren't able find recipient domain"

by setting domain => 'gmail.com'

you should specify

:domain =>  'your application name'   ( :domain => 'foo.com' or 'http://localhost:3000' ) 

also setup

config.action_mailer.delivery_method = :smtp 

you change according production, development environment.


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -