Okay, I found out the solution.
I needed tls library. I still don't understand quite why it worked
only in dev without tls, I think Heroku is using out of date library.

So, you need to find tls_smtp.rb online and add it to your lib dir in
your rails project.

1. I added this snippet in my config/environments/production.rb

config.action_mailer.smtp_settings = {
   :tls => true,
   :address  => "smtp.gmail.com",
   :port  => 587,
   :domain => 'gmail.com',
   :user_name  => "[email protected]",
   :password  => "*****",
   :authentication  => :plain
 }


2. Imported in my environment.rb
require 'tls_smtp' (right under "require File.join(File.dirname
(__FILE__), 'boot')")


Hope this helps to any of you that have the same problems!

Cheers,
SS

On Jan 23, 6:15 pm, SS <[email protected]> wrote:
> Hi Guys,
> I'm experiencing problems sending automated emails via Gmail from
> Heroku server (Production)? I can successfully send emails in
> Development environment upon new user registration, however when I try
> in Production there is no emails sent and makes me a little
> frustrated.
>
> I don't see a problem with my code in ../environment/production.rb:
>
> ----------------------Start Code---------------------------
>
> APP_URL = "http://mysite.heroku.com";
>
> config.cache_classes = true
> config.action_controller.consider_all_requests_local = false
> config.action_controller.perform_caching = true
>
> config.action_mailer.raise_delivery_errors = false
> config.action_mailer.delivery_method = :smtp
> config.action_mailer.smtp_settings = {
>         :enable_starttls_auto => true,
>         :address => "smtp.gmail.com",
>         :port => 587,
>         :domain => 'gmail.com',
>         :authentication => :plain,
>         :user_name => '[email protected]',
>         :password => 'password1'}
>
> -------------------------End Code---------------------
>
> I don't understand why it doesn't work. Is the APP_URL the problem? In
> Development APP_URL = "http://localhost:3000/"; works fine. I tried
> different variations and restarted my Heroku server after each time to
> ensure that the configuration files are loaded with the updated
> changes.
>
> Please help...
>
> SS

-- 
You received this message because you are subscribed to the Google Groups 
"CommunityEngine" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/communityengine?hl=en.

Reply via email to