• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Java Mail Text on Image

 
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 138
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 138
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
reply
    Bookmark Topic Watch Topic
  • New Topic