Topic: Configure gmails settings for sending email

My sending email function in ROR was working fine till recently without any problem and no settings were written in environment.rb file. However, now I get message SMTPauthentication error. After a great research and continous reading I came across this

config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
  :enable_starttls_auto => true,
  :address => 'smtp.gmail.com',
  :port => 465,
  :authentication => 'plain',
  :domain => 'mydomain',
  :user_name => 'username',
  :password => 'password'
}


the error has vanished and new error Error-time out as cropped up after a long pause
somebody help me

Re: Configure gmails settings for sending email

I would suspect the servers environment rather than your code. It sounds like you have an issue with either the permissions that your user is allowed (the user that the app runs under) or possibly some firewall is getting in the way.

If you ssh into your server can you send an email from the command line? If you are not sure how to do this then check the accepted answer on the S/O question http://stackoverflow.com/questions/1198 … line-linux

What you want and what you need are too often not the same thing!
When your head is hurting from trying to solve a problem, stop standing on it. When you are the right way up you will see the problem differently and you just might find the solution.
(Quote by me 15th July 2009)

Re: Configure gmails settings for sending email

This are the messages I got at various stages

[terranova]$ telnet smtp.gmail.com 25
Trying 2607:f8b0:400e:c01::6d...
Trying 173.194.79.108...
Trying 173.194.79.109...
telnet: Unable to connect to remote host: Connection refused

[terranova]$ telnet smtp.gmail.com 587
Trying 2607:f8b0:400e:c01::6d...
Connected to gmail-smtp-msa.l.google.com.
Escape character is '^]'.
220 mx.google.com ESMTP pg6sm30193587pbb.0 - gsmtp
STARTTLS
503 5.5.1 EHLO/HELO first. pg6sm30193587pbb.0 - gsmtp
helo vks1902@gmail.com
250 mx.google.com at your service
starttls
220 2.0.0 Ready to start TLS
from: admin@techpariksha.com
Connection closed by foreign host.

Please throw light if you could make out anything. thanx
venkat

Re: Configure gmails settings for sending email

According to this http://support.google.com/mail/bin/answ … swer=13287 you need to be using TLS or SSL on port 465 or 587 respectively in order for gmail to accept your sent email

Outgoing Mail (SMTP) Server - requires TLS1 or SSL:     smtp.gmail.com
Use Authentication: Yes
Port for TLS/STARTTLS: 587
Port for SSL: 465

You need to figure out your settings

What you want and what you need are too often not the same thing!
When your head is hurting from trying to solve a problem, stop standing on it. When you are the right way up you will see the problem differently and you just might find the solution.
(Quote by me 15th July 2009)