dubstep
1
Hey,
I’ve got the following problem:
I have got a complete html page with inline CSS and images (with remote
urls) that I want to send as a html email.
So what I need to do is:
- loop through img tags, extract url
- attach image, fetch cid
- change img src to cid:
Can anyone tell me what to use for this? I need something that
returns the content id after I attach an image, so I can change it in
the html.
Thanks in advance,
Christoph
sol
2
On Feb 24, 7:28pm, “Christoph B.” [email protected] wrote:
- change img src to cid:
Can anyone tell me what to use for this? I need something that
returns the content id after I attach an image, so I can change it in
the html.
Thanks in advance,
Christoph
–
Posted viahttp://www.ruby-forum.com/.
Whats a cid??
sol
3
On Fri, 25 Feb 2011 09:28:01 +0900
“Christoph B.” [email protected] wrote:
- change img src to cid:
Can anyone tell me what to use for this? I need something that
returns the content id after I attach an image, so I can change it in
the html.
I can’t give you a full solution, but to inline the image you can do
this:
require ‘base64’
fn = ‘/path/to/image.png’
src = “data:image/png;base64,#{Base64.encode64(File.read(fn))}”
new_tag = “”
Assuming you attach an ‘image/png’ file.
Martin