Methods
- attachment_with_custom_header
- cancelled_account
- cc_bcc
- custom_content_type_attributes
- custom_template
- explicitly_multipart_example
- extended_headers
- headers_with_nonalpha_chars
- html_mail
- html_mail_with_underscores
- implicitly_multipart_example
- implicitly_multipart_with_utf8
- iso_charset
- multipart_with_mime_version
- multipart_with_utf8_subject
- nested_multipart
- receive
- receive
- signed_up
- signed_up_with_url
- unencoded_subject
- unnamed_attachment
- utf8_body
- various_newlines
- various_newlines_multipart
Attributes
| [RW] | received_body | |
| [RW] | received_body |
Public Instance methods
[ show source ]
# File test/mail_service_test.rb, line 204
204: def attachment_with_custom_header(recipient)
205: recipients recipient
206: subject "custom header in attachment"
207: from "test@example.com"
208: content_type "multipart/related"
209: part :content_type => "text/html", :body => 'yo'
210: attachment :content_type => "image/jpeg",:filename => "test.jpeg", :body => "i am not a real picture", :headers => { 'Content-ID' => '<test@test.com>' }
211: end
[ show source ]
# File test/mail_service_test.rb, line 24
24: def cancelled_account(recipient)
25: self.recipients = recipient
26: self.subject = "[Cancelled] Goodbye #{recipient}"
27: self.from = "system@loudthinking.com"
28: self.sent_on = Time.local(2004, 12, 12)
29: self.body = "Goodbye, Mr. #{recipient}"
30: end
[ show source ]
# File test/mail_service_test.rb, line 32
32: def cc_bcc(recipient)
33: recipients recipient
34: subject "testing bcc/cc"
35: from "system@loudthinking.com"
36: sent_on Time.local(2004, 12, 12)
37: cc "nobody@loudthinking.com"
38: bcc "root@loudthinking.com"
39: body "Nothing to see here."
40: end
[ show source ]
# File test/mail_service_test.rb, line 231
231: def custom_content_type_attributes
232: recipients "no.one@nowhere.test"
233: subject "custom content types"
234: from "some.one@somewhere.test"
235: content_type "text/plain; format=flowed"
236: body "testing"
237: end
[ show source ]
# File test/mail_service_test.rb, line 165
165: def custom_template(recipient)
166: recipients recipient
167: subject "[Signed up] Welcome #{recipient}"
168: from "system@loudthinking.com"
169: sent_on Time.local(2004, 12, 12)
170: template "signed_up"
171:
172: body["recipient"] = recipient
173: end
[ show source ]
# File test/mail_service_test.rb, line 117
117: def explicitly_multipart_example(recipient, ct=nil)
118: recipients recipient
119: subject "multipart example"
120: from "test@example.com"
121: sent_on Time.local(2004, 12, 12)
122: body "plain text default"
123: content_type ct if ct
124:
125: part "text/html" do |p|
126: p.charset = "iso-8859-1"
127: p.body = "blah"
128: end
129:
130: attachment :content_type => "image/jpeg", :filename => "foo.jpg",
131: :body => "123456789"
132: end
[ show source ]
# File test/mail_service_test.rb, line 63
63: def extended_headers(recipient)
64: @recipients = recipient
65: @subject = "testing extended headers"
66: @from = "Grytøyr <stian1@example.net>"
67: @sent_on = Time.local 2004, 12, 12
68: @cc = "Grytøyr <stian2@example.net>"
69: @bcc = "Grytøyr <stian3@example.net>"
70: @body = "Nothing to see here."
71: @charset = "iso-8859-1"
72: end
[ show source ]
# File test/mail_service_test.rb, line 222
222: def headers_with_nonalpha_chars(recipient)
223: recipients recipient
224: subject "nonalpha chars"
225: from "One: Two <test@example.com>"
226: cc "Three: Four <test@example.com>"
227: bcc "Five: Six <test@example.com>"
228: body "testing"
229: end
[ show source ]
# File test/mail_service_test.rb, line 152
152: def html_mail(recipient)
153: recipients recipient
154: subject "html mail"
155: from "test@example.com"
156: body "<em>Emphasize</em> <strong>this</strong>"
157: content_type "text/html"
158: end
[ show source ]
# File test/mail_service_test.rb, line 160
160: def html_mail_with_underscores(recipient)
161: subject "html mail with underscores"
162: body %{<a href="http://google.com" target="_blank">_Google</a>}
163: end
[ show source ]
# File test/mail_service_test.rb, line 134
134: def implicitly_multipart_example(recipient, cs = nil, order = nil)
135: @recipients = recipient
136: @subject = "multipart example"
137: @from = "test@example.com"
138: @sent_on = Time.local 2004, 12, 12
139: @body = { "recipient" => recipient }
140: @charset = cs if cs
141: @implicit_parts_order = order if order
142: end
[ show source ]
# File test/mail_service_test.rb, line 144
144: def implicitly_multipart_with_utf8
145: recipients "no.one@nowhere.test"
146: subject "Foo áëô îü"
147: from "some.one@somewhere.test"
148: template "implicitly_multipart_example"
149: body ({ "recipient" => "no.one@nowhere.test" })
150: end
[ show source ]
# File test/mail_service_test.rb, line 42
42: def iso_charset(recipient)
43: @recipients = recipient
44: @subject = "testing isø charsets"
45: @from = "system@loudthinking.com"
46: @sent_on = Time.local 2004, 12, 12
47: @cc = "nobody@loudthinking.com"
48: @bcc = "root@loudthinking.com"
49: @body = "Nothing to see here."
50: @charset = "iso-8859-1"
51: end
[ show source ]
# File test/mail_service_test.rb, line 85
85: def multipart_with_mime_version(recipient)
86: recipients recipient
87: subject "multipart with mime_version"
88: from "test@example.com"
89: sent_on Time.local(2004, 12, 12)
90: mime_version "1.1"
91: content_type "multipart/alternative"
92:
93: part "text/plain" do |p|
94: p.body = "blah"
95: end
96:
97: part "text/html" do |p|
98: p.body = "<b>blah</b>"
99: end
100: end
[ show source ]
# File test/mail_service_test.rb, line 102
102: def multipart_with_utf8_subject(recipient)
103: recipients recipient
104: subject "Foo áëô îü"
105: from "test@example.com"
106: charset "utf-8"
107:
108: part "text/plain" do |p|
109: p.body = "blah"
110: end
111:
112: part "text/html" do |p|
113: p.body = "<b>blah</b>"
114: end
115: end
[ show source ]
# File test/mail_service_test.rb, line 192
192: def nested_multipart(recipient)
193: recipients recipient
194: subject "nested multipart"
195: from "test@example.com"
196: content_type "multipart/mixed"
197: part :content_type => "multipart/alternative", :content_disposition => "inline", :headers => { "foo" => "bar" } do |p|
198: p.part :content_type => "text/plain", :body => "test text\nline #2"
199: p.part :content_type => "text/html", :body => "<b>test</b> HTML<br/>\nline #2"
200: end
201: attachment :content_type => "application/octet-stream",:filename => "test.txt", :body => "test abcdefghijklmnopqstuvwxyz"
202: end
[ show source ]
# File test/mail_service_test.rb, line 243
243: def receive(mail)
244: self.class.received_body = mail.body
245: end
[ show source ]
# File test/url_test.rb, line 18
18: def receive(mail)
19: self.class.received_body = mail.body
20: end
[ show source ]
# File test/mail_service_test.rb, line 16
16: def signed_up(recipient)
17: @recipients = recipient
18: @subject = "[Signed up] Welcome #{recipient}"
19: @from = "system@loudthinking.com"
20: @sent_on = Time.local(2004, 12, 12)
21: @body["recipient"] = recipient
22: end
[ show source ]
# File test/url_test.rb, line 4
4: def signed_up_with_url(recipient)
5: @recipients = recipient
6: @subject = "[Signed up] Welcome #{recipient}"
7: @from = "system@loudthinking.com"
8: @sent_on = Time.local(2004, 12, 12)
9:
10: @body["recipient"] = recipient
11: @body["welcome_url"] = url_for :host => "example.com", :controller => "welcome", :action => "greeting"
12: end
[ show source ]
# File test/mail_service_test.rb, line 53
53: def unencoded_subject(recipient)
54: @recipients = recipient
55: @subject = "testing unencoded subject"
56: @from = "system@loudthinking.com"
57: @sent_on = Time.local 2004, 12, 12
58: @cc = "nobody@loudthinking.com"
59: @bcc = "root@loudthinking.com"
60: @body = "Nothing to see here."
61: end
[ show source ]
# File test/mail_service_test.rb, line 213
213: def unnamed_attachment(recipient)
214: recipients recipient
215: subject "nested multipart"
216: from "test@example.com"
217: content_type "multipart/mixed"
218: part :content_type => "text/plain", :body => "hullo"
219: attachment :content_type => "application/octet-stream", :body => "test abcdefghijklmnopqstuvwxyz"
220: end
[ show source ]
# File test/mail_service_test.rb, line 74
74: def utf8_body(recipient)
75: @recipients = recipient
76: @subject = "testing utf-8 body"
77: @from = "Foo áëô îü <extended@example.net>"
78: @sent_on = Time.local 2004, 12, 12
79: @cc = "Foo áëô îü <extended@example.net>"
80: @bcc = "Foo áëô îü <extended@example.net>"
81: @body = "åœö blah"
82: @charset = "utf-8"
83: end
[ show source ]
# File test/mail_service_test.rb, line 175
175: def various_newlines(recipient)
176: recipients recipient
177: subject "various newlines"
178: from "test@example.com"
179: body "line #1\nline #2\rline #3\r\nline #4\r\r" +
180: "line #5\n\nline#6\r\n\r\nline #7"
181: end
[ show source ]
# File test/mail_service_test.rb, line 183
183: def various_newlines_multipart(recipient)
184: recipients recipient
185: subject "various newlines multipart"
186: from "test@example.com"
187: content_type "multipart/alternative"
188: part :content_type => "text/plain", :body => "line #1\nline #2\rline #3\r\nline #4\r\r"
189: part :content_type => "text/html", :body => "<p>line #1</p>\n<p>line #2</p>\r<p>line #3</p>\r\n<p>line #4</p>\r\r"
190: end