Re: Sending E-mail Using Gmail SMTP

fattah.uign wrote:

action_mailer_tls has a problem with ruby 1.8.7. The code you posted in smtp_tls.rb produces
ArgumentError: wrong number of arguments (3 for 2) from
Line9. check_auth_args user, secret, authtype if user or secret.

You can get fix for this issue by removing authtype parameter from check_auth_args method call

    #check_auth_args user, secret, authtype if user or secret # This is for ruby 1.8.6
    check_auth_args user, secret if user or secret # This is for ruby 1.8.7

Details from http://blog.inspired.no/smtp-error-whil … -rails-271

I've patched ActionMailerTLS so it'll work on 1.8.6 or 1.8.7. You can check it out at http://github.com/hardbap/action_mailer_tls/

*** Please Note ***
If you're on Ruby 1.8.7 and Rails >= 2.2.1 you should be using the built in support.

Last edited by hardbap (2009-06-18 12:14:27)

Re: Sending E-mail Using Gmail SMTP

Can anyone post the working code? It would be nice to see the complete working solution.

Thanks

Re: Sending E-mail Using Gmail SMTP

Does that patch you put in for ActionMailerTLS allow it to work for Ruby 1.9.1 runing Rails 2.3.3? Should work out of the package for this setup but patently doesn't (at least for me).

Re: Sending E-mail Using Gmail SMTP

Hello,

I have these settings in my environment:

ActionMailer::Base.smtp_settings = {
  :address  => "smtp.gmail.com",
  :port     => 587,
  :domain   => "gmail.com",
  :authentication  => :plain,
  #:enable_starttls_auto => true,
  :user_name  => "myemail@gmail.com",
  :password  => "mypassword"
}

but it keeps showing this when I try to send email:

error => execution expired

I have logged in to gmail using above account, it's ok. And my site is now hosted on Bluehost.

Any ideas?

Giang, Nguyen Duc
Email: ndgiang84@gmail.com
Website: http://xiga.info
Please recommend for me on WorkingWithRails if you find my post useful: http://workingwithrails.com/person/1849 … -duc-giang

Re: Sending E-mail Using Gmail SMTP

I am having exactly the same issue. I run Spiceworks on a Windows 2003 Server R2 and am trying to setup email support. On smtp server field I tried both hostname and IP address of our mail server (a linux box). I am pretty sure values are correct, I can ping the mail server both by hostname and IP address from the Spiceworks server. But still, I get "SMTP Error: execution expired" when click on "Save" button after a dozen of seconds.

Re: Sending E-mail Using Gmail SMTP

I've read that using GMail for email features, you would need a valid domain name. What if I just want to use it for localhost during the development? would it work? how?

Basically, what I want is something similar to what ndgiang84 has listed above, does it work?

Thanks in advance!

Re: Sending E-mail Using Gmail SMTP

Hi,

I did some research before and I was able to make it work. I documented it in my blog for my future reference, you may use this as your reference too:

For Rails 2.3
http://www.ajibanda.com/2012/08/using-g … by-on.html

For Rails 3.2
http://www.ajibanda.com/2012/12/using-g … s-3.2.html

I was able to use gmail for this all my email related process with this codes.