Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

1.4 version - update docs

  • Loading branch information...
commit 86334dff93fae623d46e7386621caf189f0e61aa 1 parent b943639
Ben Prew authored November 28, 2011
14  README.rdoc
Source Rendered
@@ -18,7 +18,7 @@ Pony uses /usr/sbin/sendmail to send mail if it is available, otherwise it uses
18 18
 This can be over-ridden if you specify a via option:
19 19
 
20 20
   Pony.mail(:to => 'you@example.com', :via => :smtp) # sends via SMTP
21  
-  
  21
+
22 22
   Pony.mail(:to => 'you@example.com', :via => :sendmail) # sends via sendmail
23 23
 
24 24
 You can also specify options for SMTP:
@@ -63,7 +63,7 @@ Note: An attachment's mime-type is set based on the filename (as dictated by the
63 63
 
64 64
 Pony allows you to specify custom mail headers
65 65
   Pony.mail(
66  
-    :to => 'me@example.com', 
  66
+    :to => 'me@example.com',
67 67
     :headers => { "List-ID" => "...", "X-My-Custom-Header" => "what a cool custom header" }
68 68
   )
69 69
 
@@ -82,18 +82,19 @@ Options passed pretty much directly to Mail
82 82
  attachments # see Attachments section above
83 83
  headers # see Custom headers section above
84 84
  message_id
85  
- sender
  85
+ sender  # Sets "envelope from" (and the Sender header)
  86
+ reply_to
86 87
 
87 88
 Other options
88 89
  via # :smtp or :sendmail, see Transport section above
89 90
  via_options # specify transport options, see Transport section above
90 91
 
91  
-== Set default options 
  92
+== Set default options
92 93
 
93 94
 Default options can be set so that they don't have to be repeated. The default options you set will be overriden by any options you pass in to Pony.mail()
94 95
 
95 96
   Pony.options = { :from => 'noreply@example.com', :via => :smtp, :via_options => { :host => 'smtp.yourserver.com' } }
96  
-  Pony.mail(:to => 'foo@bar') # Sends mail to foo@bar from noreply@example.com using smtp 
  97
+  Pony.mail(:to => 'foo@bar') # Sends mail to foo@bar from noreply@example.com using smtp
97 98
   Pony.mail(:from => 'pony@example.com', :to => 'foo@bar') # Sends mail to foo@bar from pony@example.com using smtp
98 99
 
99 100
 == Help
@@ -134,6 +135,9 @@ mailing list: ponyrb@googlegroups.com
134 135
 
135 136
 == Releases
136 137
 
  138
+1.4
  139
+* Updated docs
  140
+
137 141
 1.3
138 142
 * Add new option :text_part_charset, which allows you to specify the charset for the text portion
139 143
 
68  lib/pony.rb
@@ -2,30 +2,30 @@
2 2
 require 'base64'
3 3
 
4 4
 # = The express way to send email in Ruby
5  
-# 
  5
+#
6 6
 # == Overview
7  
-# 
  7
+#
8 8
 # Ruby no longer has to be jealous of PHP's mail() function, which can send an email in a single command.
9  
-# 
  9
+#
10 10
 #   Pony.mail(:to => 'you@example.com', :from => 'me@example.com', :subject => 'hi', :body => 'Hello there.')
11 11
 #   Pony.mail(:to => 'you@example.com', :html_body => '<h1>Hello there!</h1>', :body => "In case you can't read html, Hello there.")
12 12
 #   Pony.mail(:to => 'you@example.com', :cc => 'him@example.com', :from => 'me@example.com', :subject => 'hi', :body => 'Howsit!')
13  
-# 
  13
+#
14 14
 # Any option key may be omitted except for :to. For a complete list of options, see List Of Options section below.
15  
-# 
16  
-# 
  15
+#
  16
+#
17 17
 # == Transport
18  
-# 
  18
+#
19 19
 # Pony uses /usr/sbin/sendmail to send mail if it is available, otherwise it uses SMTP to localhost.
20  
-# 
  20
+#
21 21
 # This can be over-ridden if you specify a via option:
22  
-# 
  22
+#
23 23
 #   Pony.mail(:to => 'you@example.com', :via => :smtp) # sends via SMTP
24  
-#   
  24
+#
25 25
 #   Pony.mail(:to => 'you@example.com', :via => :sendmail) # sends via sendmail
26  
-# 
  26
+#
27 27
 # You can also specify options for SMTP:
28  
-# 
  28
+#
29 29
 #   Pony.mail(:to => 'you@example.com', :via => :smtp, :via_options => {
30 30
 #     :address        => 'smtp.yourserver.com',
31 31
 #     :port           => '25',
@@ -34,9 +34,9 @@
34 34
 #     :authentication => :plain, # :plain, :login, :cram_md5, no auth by default
35 35
 #     :domain         => "localhost.localdomain" # the HELO domain provided by the client to the server
36 36
 #   }
37  
-# 
  37
+#
38 38
 # Gmail example (with TLS/SSL)
39  
-# 
  39
+#
40 40
 #   Pony.mail(:to => 'you@example.com', :via => :smtp, :via_options => {
41 41
 #     :address              => 'smtp.gmail.com',
42 42
 #     :port                 => '587',
@@ -46,32 +46,32 @@
46 46
 #     :authentication       => :plain, # :plain, :login, :cram_md5, no auth by default
47 47
 #     :domain               => "localhost.localdomain" # the HELO domain provided by the client to the server
48 48
 #   })
49  
-# 
  49
+#
50 50
 # And options for Sendmail:
51  
-# 
  51
+#
52 52
 #   Pony.mail(:to => 'you@example.com', :via => :smtp, :via_options => {
53 53
 #     :location  => '/path/to/sendmail' # this defaults to 'which sendmail' or '/usr/sbin/sendmail' if 'which' fails
54 54
 #     :arguments => '-t' # -t and -i are the defaults
55 55
 #   }
56  
-# 
  56
+#
57 57
 # == Attachments
58  
-# 
  58
+#
59 59
 # You can attach a file or two with the :attachments option:
60  
-# 
  60
+#
61 61
 #   Pony.mail(..., :attachments => {"foo.zip" => File.read("path/to/foo.zip"), "hello.txt" => "hello!"})
62  
-# 
  62
+#
63 63
 # Note: An attachment's mime-type is set based on the filename (as dictated by the ruby gem mime-types).  So 'foo.pdf' has a mime-type of 'application/pdf'
64  
-# 
  64
+#
65 65
 # == Custom Headers
66  
-# 
  66
+#
67 67
 # Pony allows you to specify custom mail headers
68 68
 #   Pony.mail(
69  
-#     :to => 'me@example.com', 
  69
+#     :to => 'me@example.com',
70 70
 #     :headers => { "List-ID" => "...", "X-My-Custom-Header" => "what a cool custom header" }
71 71
 #   )
72  
-# 
  72
+#
73 73
 # == List Of Options
74  
-# 
  74
+#
75 75
 # Options passed pretty much directly to Mail
76 76
 #  to
77 77
 #  cc
@@ -81,21 +81,23 @@
81 81
 #  html_body # for sending html-formatted email
82 82
 #  subject
83 83
 #  charset # In case you need to send in utf-8 or similar
  84
+#  text_part_charset # for multipart messages, set the charset of the text part
84 85
 #  attachments # see Attachments section above
85 86
 #  headers # see Custom headers section above
86 87
 #  message_id
87 88
 #  sender  # Sets "envelope from" (and the Sender header)
88  
-# 
  89
+#  reply_to
  90
+#
89 91
 # Other options
90 92
 #  via # :smtp or :sendmail, see Transport section above
91 93
 #  via_options # specify transport options, see Transport section above
92 94
 #
93  
-# == Set default options 
94  
-# 
  95
+# == Set default options
  96
+#
95 97
 # Default options can be set so that they don't have to be repeated. The default options you set will be overriden by any options you pass in to Pony.mail()
96  
-# 
  98
+#
97 99
 #   Pony.options = { :from => 'noreply@example.com', :via => :smtp, :via_options => { :host => 'smtp.yourserver.com' } }
98  
-#   Pony.mail(:to => 'foo@bar') # Sends mail to foo@bar from noreply@example.com using smtp 
  100
+#   Pony.mail(:to => 'foo@bar') # Sends mail to foo@bar from noreply@example.com using smtp
99 101
 #   Pony.mail(:from => 'pony@example.com', :to => 'foo@bar') # Sends mail to foo@bar from pony@example.com using smtp
100 102
 
101 103
 
@@ -104,12 +106,12 @@ module Pony
104 106
   @@options = {}
105 107
 
106 108
 # Default options can be set so that they don't have to be repeated.
107  
-# 
  109
+#
108 110
 #   Pony.options = { :from => 'noreply@example.com', :via => :smtp, :via_options => { :host => 'smtp.yourserver.com' } }
109  
-#   Pony.mail(:to => 'foo@bar') # Sends mail to foo@bar from noreply@example.com using smtp 
  111
+#   Pony.mail(:to => 'foo@bar') # Sends mail to foo@bar from noreply@example.com using smtp
110 112
 #   Pony.mail(:from => 'pony@example.com', :to => 'foo@bar') # Sends mail to foo@bar from pony@example.com using smtp
111 113
   def self.options=(value)
112  
-    @@options = value 
  114
+    @@options = value
113 115
   end
114 116
 
115 117
   def self.options()
2  pony.gemspec
@@ -2,7 +2,7 @@
2 2
 
3 3
 Gem::Specification.new do |s|
4 4
   s.name = %q{pony}
5  
-  s.version = "1.3"
  5
+  s.version = "1.4"
6 6
 
7 7
   s.description = "Send email in one command: Pony.mail(:to => 'someone@example.com', :body => 'hello')"
8 8
   s.summary = s.description

0 notes on commit 86334df

Please sign in to comment.
Something went wrong with that request. Please try again.