D
Damjan Rems
And the picture will show (not as attachment) on gmail or outlook
client. This is what I am doing(according to what I have found on net),
but all I get is a square which tells where picture should be shown but
it isn't.
-----------------
require 'net/smtp'
require 'rubygems'
require 'mail'
c = File.open('mygif.gif','rb') { |f| f.read }
mail = Mail.new
mail.subject = 'Some subject'
mail.attachments['mygif.gif'] = c
id = mail.attachments.first.content_id.gsub(/<|>/,'')
html_part = Mail:art.new do
content_type 'text/html; charset=UTF8'
body "<p><img width=\"800\" height=\"600\" src=\"cid: #{id}\"></p>"
alt=\"somename\">"
end
mail.html_part = html_part
send_mail mail.to_s
-----------------
I even tried this but it isn't working neither.
body "<img width=\"800\" height=\"600\"
src=\"data:image/gif;base64,#{Base64.b64encode(c)}\"
by
TheR
client. This is what I am doing(according to what I have found on net),
but all I get is a square which tells where picture should be shown but
it isn't.
-----------------
require 'net/smtp'
require 'rubygems'
require 'mail'
c = File.open('mygif.gif','rb') { |f| f.read }
mail = Mail.new
mail.subject = 'Some subject'
mail.attachments['mygif.gif'] = c
id = mail.attachments.first.content_id.gsub(/<|>/,'')
html_part = Mail:art.new do
content_type 'text/html; charset=UTF8'
body "<p><img width=\"800\" height=\"600\" src=\"cid: #{id}\"></p>"
alt=\"somename\">"
end
mail.html_part = html_part
send_mail mail.to_s
-----------------
I even tried this but it isn't working neither.
body "<img width=\"800\" height=\"600\"
src=\"data:image/gif;base64,#{Base64.b64encode(c)}\"
by
TheR