when i send a email with attachment, sometimes the attachment is not
displayed as such and is not be found in the email, but the size of the
email is still big (as with attachment). it's probably hidden base64
encoded in the sourcecode.
now the hard part. i only got this information from customers and cannot
stage this error in my development environment.
my code is quite easy:
def offer(docs = [])
# attach files
docs.compact.each do |document|
attachments[document.filename] = File.open(document.url, 'rb')
{|file| file.read} ## I need to read 'rb' because i am on a win-server
end
mail(:to => "<email>", :subject => "<subject>")
end
any suggestions? how can i assure, that the attachment will be
displayed?
the attachments are always pdfs (if thats somehow important).
--
Posted via http://www.ruby-forum.com/.
------------------------------------
From - Mon Jul 25 08:57:15 2011
X-Account-Key: ....
X-UIDL: ...
X-Mozilla-Status: 0000
X-Mozilla-Status2: 00000000
X-Mozilla-Keys:
Return-Path: <EMAIL>
Delivery-Date: Mon, 25 Jul 2011 08:56:34 +0200
Received: <...>
Received: <...>
Date: Mon, 25 Jul 2011 08:57:10 +0200
From: <FROM-EMAIL>
To: <TO-EMAIL>
Message-ID: <ID>
Subject: <SUBJECT>
Mime-Version: 1.0
Content-Type: multipart/mixed;
boundary="--==_mimepart_4e2d13c67e1f9_f802f425a49071a";
charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Provags-ID: V02:K0:4sH+tl1KaCL9J0SiYZeTkVUH/mKVAi7kbImpVvQUvpK
v0S8xsUin+u9FXoHrGUSYSxJ6dVCFMI4XJOEjQ/u372LWpLWBP
XeT8gpckabGQClzxkFStLW8YqOC1otjEwhz8i7xjzdRUCy9fdh
Ij9wIq5taa9KEoR4vXlLdEBwxB6u6w7s4lCt2XTftaCGGP6y/A
z4rvh0KMtlQiuv3U71BXdHT8rFD2gjTHZMLE8xE1lE=
Envelope-To: <EMAIL>
----==_mimepart_4e2d13c67e1f9_f802f425a49071a
Date: Mon, 25 Jul 2011 08:57:10 +0200
Mime-Version: 1.0
Content-Type: text/plain;
charset=UTF-8
Content-Transfer-Encoding: 7bit
Content-ID: <ID>
****
<PLAIN TEXT>
****
----==_mimepart_4e2d13c67e1f9_f802f425a49071a
Date: Mon, 25 Jul 2011 08:57:10 +0200
Mime-Version: 1.0
Content-Type: application/pdf;
charset=UTF-8;
filename=<FILENAME>
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename=<FILENAME>
Content-ID: <ID>
<base64 ENCODED CONTENT OF PDF>
----==_mimepart_4e2d13c67e1f9_f802f425a49071a--
Look correct, right?
"Which email client *isn't* showing this message correctly?"
that's the hard part. my clients (VERY few of them) sometimes just say:
"we didnt receive any attachments"
but i am guessing that they are using some standard clients. because
when i send the same pdf with thunderbird to them, they receive it.
any ideas?
thanks for all your work."Which email client *isn't* showing this message correctly?"
that's the hard part. my clients (VERY few of them) sometimes just say:
"we didnt receive any attachments"but i am guessing that they are using some standard clients. because
when i send the same pdf with thunderbird to them, they receive it.any ideas?
so you think, i have to set the mime-type of each attachment
manually/explicitly?
if i have any further hints on whats wrong i will get back to you (if i
may) or the mail group.
thanks again