# Smtp\_tls 1.0.3 Released

**URL:** <https://www.ruby-forum.com/t/smtp-tls-1-0-3-released/171774>\
**Category:** Ruby\
**Created:** [July 9, 2009, 12:33am UTC](https://www.ruby-forum.com/t/smtp-tls-1-0-3-released/171774 "2009-07-09T00:33:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![miracleofmagick](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/71c47a/32.png) [@miracleofmagick](https://www.ruby-forum.com/u/miracleofmagick)\
**Post date:** [July 9, 2009, 12:33am UTC](https://www.ruby-forum.com/t/smtp-tls-1-0-3-released/171774/1 "2009-07-09T00:33:51Z")

</div>

smtp\_tls version 1.0.3 has been released!

- [http://seattlerb.rubyforge.org/smtp\_tls](http://seattlerb.rubyforge.org/smtp_tls)

Provides SMTP STARTTLS support for Ruby 1.8.6 (built-in for 1.8.7+).  
Simply  
require ‘smtp\_tls’ and use the Net::SMTP#enable\_starttls method to talk  
to  
servers that use STARTTLS.

require ‘net/smtp’  
begin  
require ‘smtp\_tls’  
rescue LoadError  
end

smtp = Net::SMTP.new address, port  
smtp.enable\_starttls  
smtp.start Socket.gethostname, user, password, authentication do  
|server|  
server.send\_message message, from, to  
end

You can also test your SMTP connection settings using mail\_smtp\_tls:

$ date | ruby -Ilib bin/mail\_smtp\_tls [smtp.example.com](http://smtp.example.com) submission   
“your username” “your password” plain   
removed\_email\_address@domain.invalid removed\_email\_address@domain.invalid  
Using SMTP\_TLS 1.0.3  
 → “220 [smtp.example.com](http://smtp.example.com) ESMTP XXX\r\n”  
 ← “EHLO [you.example.com](http://you.example.com)\r\n”  
 → “[250-smtp.example.com](http://250-smtp.example.com) at your service, [192.0.2.1]\r\n”  
 → “250-SIZE 35651584\r\n”  
 → “250-8BITMIME\r\n”  
 → “250-STARTTLS\r\n”  
 → “250-ENHANCEDSTATUSCODES\r\n”  
 → “250 PIPELINING\r\n”  
 ← “STARTTLS\r\n”  
 → “220 2.0.0 Ready to start TLS\r\n”  
TLS connection started  
 ← “EHLO [you.example.com](http://you.example.com)\r\n”  
 → “[250-smtp.example.com](http://250-smtp.example.com) at your service, [192.0.2.1]\r\n”  
 → “250-SIZE 35651584\r\n”  
 → “250-8BITMIME\r\n”  
 → “250-AUTH LOGIN PLAIN\r\n”  
 → “250-ENHANCEDSTATUSCODES\r\n”  
 → “250 PIPELINING\r\n”  
 ← “AUTH PLAIN BASE64\_STUFF\_HERE\r\n”  
 → “235 2.7.0 Accepted\r\n”  
 ← “MAIL FROM:[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)\r\n”  
 → “250 2.1.0 OK XXX\r\n”  
 ← “RCPT TO:[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)\r\n”  
 → “250 2.1.5 OK XXX\r\n”  
 ← “DATA\r\n”  
 → “354 Go ahead XXX\r\n”  
writing message from String  
wrote 91 bytes  
 → “250 2.0.0 OK 1247028988 XXX\r\n”  
 ← “QUIT\r\n”  
 → “221 2.0.0 closing connection XXX\r\n”

This will connect to [smtp.example.com](http://smtp.example.com) using the submission port (port  
587)  
with a username and password of “your username” and “your password” and  
authenticate using plain-text auth (the submission port always uses SSL)  
then  
send the current date to removed\_email\_address@domain.invalid from removed\_email\_address@domain.invalid.

Debug output from the connection will be printed on stderr.

Changes:

### 1.0.3 / 2009-07-??

- 1 minor enhancement

- 2 bug fixes
