aspose file tools*
The moose likes Other JSE/JEE APIs and the fly likes Java Mail Text on Image Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Java Mail Text on Image" Watch "Java Mail Text on Image" New topic
Author

Java Mail Text on Image

naga eswar
Ranch Hand

Joined: Jan 25, 2012
Posts: 120
Hi all,

We are working on a JavaMail to send an image on mailbody by adding text to the image.

Every thing is fine but in the image we are getting image and only text is reflecting. below is the code.

Below is the HTML code for mail sending. We have taken table background as image and a text which it position will be on the image.




we are setting content as below for image




Can anybody please do the needful.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19762
    
  20

The "background" attribute is only supported for BODY elements. Any other elements (well, BODY as well...) should use CSS for applying background images. However, I'm not sure if email clients support that.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
naga eswar
Ranch Hand

Joined: Jan 25, 2012
Posts: 120
Thanks for your reply Rob.

Yes. I have worked with CSS but still same probelm.




Can any help me. How tosend mail with text on image in mail body.
Note: Text will changes mail to mail.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19762
    
  20

Right now your image isn't referred to as an embedded image. To be honest, I don't even know if it's possible to embed images used in CSS.

What could be a possibility is to use an image tag that is positioned at the same location as the table. The table needs to be transparent, but all should be achievable using CSS.
naga eswar
Ranch Hand

Joined: Jan 25, 2012
Posts: 120
Thanks Rob.

What I observed, if I am using background image is not reflecting and if i am using <img src....> its working fine.

But the position of the text going down after the image. Its not coming on the text. See below code.








Div or style is not working. Can you please help me any alternate solution.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java Mail Text on Image