mailfactory-acd 1.4.0 → 1.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mailfactory.rb +7 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7944ba1c34653b3ef22ca177489516e4b9c743d4
|
4
|
+
data.tar.gz: 42206921b890dfa2c00acdd1956f6ea07a97aa07
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 46d34ad603e9496e24d9da646d8cca4459d61df8357dfa8f1c3628677a805fe109fb3ddd0e20a0985ff616bd0ffec58fae1c6831ba2dcee49b19d58f780cb779
|
7
|
+
data.tar.gz: 89b194d5a70f2ca254faed154e7153ad3509ba212a0b3a8d08261da189690733fc385c43afab662ecf625c454fb7763b4ab352af2298604f46566b1b095bcb1b
|
data/lib/mailfactory.rb
CHANGED
@@ -48,7 +48,7 @@ end
|
|
48
48
|
# An easy class for creating a mail message
|
49
49
|
class MailFactory
|
50
50
|
|
51
|
-
VERSION = '1.4.
|
51
|
+
VERSION = '1.4.1'
|
52
52
|
|
53
53
|
def initialize()
|
54
54
|
@headers = Array.new()
|
@@ -278,13 +278,17 @@ class MailFactory
|
|
278
278
|
|
279
279
|
if(type != nil)
|
280
280
|
attachment['mimetype'] = type.to_s()
|
281
|
+
elsif(file['\n'])
|
282
|
+
attachment['mimetype'] = MIME::Types.type_for(emailfilename).to_s
|
281
283
|
elsif(file.kind_of?(String) or file.kind_of?(Pathname))
|
282
284
|
attachment['mimetype'] = MIME::Types.type_for(file.to_s()).to_s
|
283
285
|
else
|
284
286
|
attachment['mimetype'] = ''
|
285
287
|
end
|
286
288
|
|
287
|
-
if(file
|
289
|
+
if(file['\n'])
|
290
|
+
attachment['attachment'] = file_encode(file)
|
291
|
+
elsif(file.kind_of?(String) or file.kind_of?(Pathname))
|
288
292
|
# Open in rb mode to handle Windows, which mangles binary files opened in a text mode
|
289
293
|
File.open(file.to_s(), "rb") { |fp|
|
290
294
|
attachment['attachment'] = file_encode(fp.read())
|
@@ -462,4 +466,4 @@ protected
|
|
462
466
|
end
|
463
467
|
end
|
464
468
|
|
465
|
-
end
|
469
|
+
end
|