File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java Mail Text on Image

 
naga eswar
Ranch Hand
Posts: 122
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 20372
44
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
naga eswar
Ranch Hand
Posts: 122
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 20372
44
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 122
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic