I m developing web application using Ruby on Rails. I want to display an image in mail using net/smtp.. my code is...
msgstr = <<END_OF_MESSAGE
From: Your Name <your@mail.address>
To: Destination Address <someone@example.com>
MIME-Version: 1.0
Content-type: text/html
Subject: test message
Date: Sat, 23 Jun 2001 16:26:43 +0900
Message-Id: <unique.message.id.string@example.com>
<img src = "/my_proj/public/images/logo.jpeg" alt= "logo">
<b> This is a test message.</b>
END_OF_MESSAGE
require 'net/smtp'
Net::SMTP.start('your.smtp.server', 25) do |smtp|
smtp.send_message msgstr,
'your@mail.address',
'his_addess@example.com'
end
It is sending mail with all tags but not displaying th image while displaying alternate text. I hav put jpeg file every where n tested it.. but its not gettng the path of file and diplying the alternate text. Please anyone help me.. how to define path of file... or where to put this image file. I have changed
Content-type: text/html image/jpeg
but still its not working.