Plugins - ActionMailer TLS

StarAdd to favorites

This plugin allows ActionMailer to work with SMTP servers that require TLS. It is heavily monkeypatched into ActionMailer and Net/SMTP, but such is life. Just set the following, and proceed as usual:

ActionMailer::Base.server_settings[:tls] = true

I haven’t quite figured out the best way to test this plugin, but if you execute the following command, you should receive a gmail from yourself, and a fair amount of debug information will be output. I hope it suffices; if not, suggest an improvement!

rake EMAIL=my_gmail_account@gmail.com PASSWORD=secret

Kyle Maxwell

http://svn.douglasfshearer.com/rails/plugins/action_mailer_optional_tls

Rails' (MIT)

  • Currently 3.3/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Misc. Enhancements

Tags

Comments

Add a comment
Maksim Khrapov 1 Jul 2008

The repository seems to have disappeared.

andreister 22 Aug 2007

Hello, that's a great sample! Though it seems to fail for me (ruby 1.8.5 with rails 1.2.3)

While testing, I get this error: testsendmail(TlsTest): Errno::EBADF: Bad file descriptor - connect(2) lib/smtp_tls.rb:34:in initialize' lib/smtp_tls.rb:34:inopen' lib/smtp_tls.rb:34:in do_tls_start' c:/ruby/lib/ruby/1.8/timeout.rb:56:intimeout' c:/ruby/lib/ruby/1.8/timeout.rb:76:in timeout' lib/smtp_tls.rb:34:indotlsstart' lib/smtp_tls.rb:18:in send' lib/smtp_tls.rb:18:instart' lib/smtp_tls.rb:10:in start' lib/action_mailer_tls.rb:9:inperformdeliverysmtp' c:/ruby/lib/ruby/gems/1.8/gems/actionmailer-1.3.3/lib/action_mailer/base.rb:451:in send' c:/ruby/lib/ruby/gems/1.8/gems/actionmailer-1.3.3/lib/action_mailer/base.rb:451:indeliver!' c:/ruby/lib/ruby/gems/1.8/gems/actionmailer-1.3.3/lib/action_mailer/base.rb:333:in method_missing' ./test/tls_test.rb:30:intestsendmail'

I wonder if you possibly could suggest anything...

Thanks a lot!

Toine Diepstraten 19 Jul 2007

Nice work!

Only problem it seems to throw a SSL exception "Wrong Version number" right after the email was accepted by the SMTP server, when used with an gmail account (tested with Ruby 1.8.6, Rails 1.2.3 that is).

Search Plugins

Query syntax

Plugins by Category

Sponsors

Rails Kits: Get Code. Get Moving.

Have a comment?