Groups
Groups
Sign in
Groups
Groups
Ruby on Rails: Talk
Conversations
About
Send feedback
Help
image attachment in mail with rails3
30 views
Skip to first unread message
amruby
unread,
Jul 31, 2012, 6:29:18 AM
7/31/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to rubyonra...@googlegroups.com
yes this will send one mail with attachment of image.png. But when i open or download that image, that is empty.?
imageurl =
https://chart.googleapis.com/chart?chs=150x150&cht=qr&chl=5&choe=UTF-8
require 'open-uri'
class UserMailer < ActionMailer::Base
default :from => "
ma...@example.com
"
def welcome_email(imageurl,mailid)
attachments['QR.png'] = {:mime_type => 'image/png',
:content => open(URI.parse(imageURL))}
mail(:to => mailid,
:subject => "Code",
:body => "Code")
end
end
Thanks
vishnu
Reply all
Reply to author
Forward
0 new messages