lib/mailit/mail.rb in manveru-mailit-2009.06.08 vs lib/mailit/mail.rb in manveru-mailit-2009.08
- old
+ new
@@ -137,11 +137,11 @@
container = {
:filename => Pathname.new(filename).basename,
:mimetype => (mimetype || mime_type_for(filename)),
}
- add_attachment_common(container, file, headers)
+ add_attachment_common(container, filename, headers)
end
alias attach add_attachment
def add_attachment_as(file, filename, mimetype = nil, headers = nil)
container = {
@@ -210,10 +210,10 @@
@headers.map{|key, value| value if regex =~ key }.compact
end
alias [] get_header
def header_string
- headers.join("\r\n") << "\r\n\r\n"
+ headers.map{|key,value| "#{key}: #{value}"}.join("\r\n") << "\r\n\r\n"
end
MIME_INDICATOR = "This is a multi-part message in MIME format.\r\n\r\n--%s\r\nContent-Type: multipart/alternative; boundary=%p"
def body_string