# Problem sending email from restful authentication

**URL:** <https://www.ruby-forum.com/t/problem-sending-email-from-restful-authentication/176933>\
**Category:** Rails\
**Created:** [October 8, 2009, 4:33pm UTC](https://www.ruby-forum.com/t/problem-sending-email-from-restful-authentication/176933 "2009-10-08T16:33:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![spacechurro](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/d2c977/32.png) [@spacechurro](https://www.ruby-forum.com/u/spacechurro)\
**Post date:** [October 8, 2009, 4:33pm UTC](https://www.ruby-forum.com/t/problem-sending-email-from-restful-authentication/176933/1 "2009-10-08T16:33:36Z")

</div>

i am having problems sending email using the restful authentication  
plugin…

the trick is, it seems there is a problem in getting openssl to work… i  
am not sure where this falls into the scheme of things…

the error code i am getting is:

OpenSSL::SSL::SSLError (hostname was not match with the server  
certificate):  
/usr/local/lib/ruby/1.8/openssl/ssl.rb:123:in `post_connection_check' /usr/local/lib/ruby/1.8/net/smtp.rb:582:in`tlsconnect’  
/usr/local/lib/ruby/1.8/net/smtp.rb:562:in `do_start' /usr/local/lib/ruby/1.8/net/smtp.rb:525:in`start’  
app/models/user\_observer.rb:3:in `after_create' /usr/local/lib/ruby/1.8/observer.rb:185:in`notify\_observers’  
/usr/local/lib/ruby/1.8/observer.rb:184:in `each' /usr/local/lib/ruby/1.8/observer.rb:184:in`notify\_observers’  
app/controllers/users\_controller.rb:14:in `create’

---

<div class="post-metadata">

**Author:** ![spacechurro](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/d2c977/32.png) [@spacechurro](https://www.ruby-forum.com/u/spacechurro)\
**Post date:** [October 8, 2009, 5:31pm UTC](https://www.ruby-forum.com/t/problem-sending-email-from-restful-authentication/176933/2 "2009-10-08T17:31:27Z")

</div>

Most problems with smtp come from an incorrect configuration. Can you  
show more details of how you configure?

i.e. For me, a functional configuration for sending mail through gmail  
looks like this (from config/initializers/action\_mailer.rb):

ActionMailer::Base.delivery\_method = :smtp  
ActionMailer::Base.raise\_delivery\_errors = true  
ActionMailer::Base.smtp\_settings = {  
:enable\_starttls\_auto =\> true,  
:address =\> “[smtp.gmail.com](http://smtp.gmail.com)”,  
:port =\> “587”,  
:domain =\> “engine.local”,  
:authentication =\> :plain,  
:user\_name =\> “bultaco.rick”,  
:password =\> “\*\*\*\*\*\*”  
}

On Oct 8, 10:33 am, Sergio R. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![spacechurro](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/d2c977/32.png) [@spacechurro](https://www.ruby-forum.com/u/spacechurro)\
**Post date:** [October 8, 2009, 10:10pm UTC](https://www.ruby-forum.com/t/problem-sending-email-from-restful-authentication/176933/3 "2009-10-08T22:10:09Z")

</div>

hmm…

okay, i was initially used to setting up actionmailer (to use smtp) in  
environments, i think…

i have recently upgraded my rails… i think it’s in a new place…

it didn’t put it in initializers either… poking around…

thanks!
