Am 06.10.2012 12:45, schrieb Ferdous ara:
> unknown wrote in post #1078810:
>> Am 06.10.2012 12:28, schrieb Ferdous ara:
>>> but i dont see the image ..
>> you could try `puts message` instead of sending it.
>> is the image included in the output string?
>
> Sorry did not understand what you meant..

First, look at the source code of the email you received.
If the image is embedded but not displayed, it could be
a problem with your email program.

If the image is not embedded in the first place you have to
poke into the code and try to figure out what is going on...

The simplest way to debug some code is including puts statements
to display the values of your variables, like src, message.

>> did you try saving the HTML part of the message
>> into a file and open it with a browser?
>
> how you want me to save this in to html ?? by using ruby cgi ??

This has nothing to do with cgi. Just change your program like shown
below and run it. This saves the HTML snippet of your message to a file
(instead of sending it). Then open the created HTML file in your
browser. Does it display your image? (In my case it does.)

   ...

   message = <<MESSAGE_END
   <p><img src="#{src}" alt="test.png" width="32" height="32"></p>
   MESSAGE_END

   File.open('test.html', 'w') {|f| f.puts message }



-- 
<https://github.com/stomar/>