Hello , I got trouble here and need assist here !
All I wanna do is to send a [text/html] content-typed mail
I want to use the [send_data] method to send the pic(id = 1 , name
=‘aa’ , data, type= ‘jpeg’) from my database
class MyMailer < ActionMailer::Base
def send()
@subject = 'this is a test of my mailing system'
@body = {:pic=>show}
@recipients = '[email protected]'
@from = '[email protected]'
@sent_on = Time.now
@headers = {}
@content_type = "text/html"
end
def show
@picture = Picture.find(1)
send_data(
@picture.data,
:filename=>@picture.name,
:type=>@picture.content_type,
:dispotion=>"inline"
)
end
this is send.erb ,
Dear
this is a testing letter , to see if i can send a pic via a mail
<%= @pic %>
surely won't work eh? but could I know what can we do to make it work