<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -29,6 +29,20 @@ You can also specify options for SMTP:
     :domain =&gt; &quot;localhost.localdomain&quot; # the HELO domain provided by the client to the server
   }
 
+== TLS/SSL
+
+With smtp transport it also possible to use TLS/SSL:
+
+  Pony.mail(:to =&gt; 'you@example.com', :via =&gt; :smtp, :smtp =&gt; {
+    :host   =&gt; 'smtp.gmail.com',
+    :port   =&gt; '587',
+    :tls    =&gt; true,
+    :user   =&gt; 'user',
+    :pass   =&gt; 'pass',
+    :auth   =&gt; :plain # :plain, :login, :cram_md5, no auth by default
+    :domain =&gt; &quot;localhost.localdomain&quot; # the HELO domain provided by the client to the server
+  })
+
 == Attachments
 
 You can attach a file or two with the :attachments option:</diff>
      <filename>README.rdoc</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,9 @@
 require 'rubygems'
 require 'net/smtp'
+begin
+	require 'smtp_tls'
+rescue LoadError
+end
 require 'base64'
 begin
 	require 'tmail'
@@ -70,6 +74,10 @@ module Pony
 		default_options = {:smtp =&gt; { :host =&gt; 'localhost', :port =&gt; '25', :domain =&gt; 'localhost.localdomain' }}
 		o = default_options[:smtp].merge(options[:smtp])
 		smtp = Net::SMTP.new(o[:host], o[:port])
+		if o[:tls]
+			raise &quot;You may need: gem install smtp_tls&quot; unless smtp.respond_to?(:enable_starttls)
+			smtp.enable_starttls
+		end
 		if o.include?(:auth)
 			smtp.start(o[:domain], o[:user], o[:password], o[:auth])
 		else</diff>
      <filename>lib/pony.rb</filename>
    </modified>
    <modified>
      <diff>@@ -96,6 +96,12 @@ Y29udGVudCBvZiBmb28udHh0
 				Pony.transport_via_smtp(mock('tmail', :to =&gt; 'to', :from =&gt; 'from', :to_s =&gt; 'message'), o)
 			end
 
+			it &quot;enable starttls when tls option is true&quot; do
+				o = { :smtp =&gt; { :user =&gt; 'user', :password =&gt; 'password', :auth =&gt; 'plain', :tls =&gt; true}}
+				@smtp.should_receive(:enable_starttls)
+				Pony.transport_via_smtp(mock('tmail', :to =&gt; 'to', :from =&gt; 'from', :to_s =&gt; 'message'), o)
+			end
+
 			it &quot;starts the job&quot; do
 				@smtp.should_receive(:start)
 				Pony.transport_via_smtp(mock('tmail', :to =&gt; 'to', :from =&gt; 'from', :to_s =&gt; 'message'))</diff>
      <filename>spec/pony_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>64b3c224d1229b9cfa8b9632d053d24c263f5e2c</id>
    </parent>
  </parents>
  <author>
    <name>Hiroshi Saito</name>
    <email>hiroshi3110@gmail.com</email>
  </author>
  <url>http://github.com/hiroshi/pony/commit/b0199ecd7173005a06d24a9c06df94387b89eae8</url>
  <id>b0199ecd7173005a06d24a9c06df94387b89eae8</id>
  <committed-date>2009-07-09T22:10:16-07:00</committed-date>
  <authored-date>2009-07-09T22:10:16-07:00</authored-date>
  <message>Use TLS if :tls =&gt; true</message>
  <tree>cc4f6b30dd0321149324e11eebb5daae71cba03d</tree>
  <committer>
    <name>Hiroshi Saito</name>
    <email>hiroshi3110@gmail.com</email>
  </committer>
</commit>
