• 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
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Bear Bibeault
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh

Email to include signature

 
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I am using the AbstractMailMessageSender to send email from our application to user.
I have extended this class to include the Attachments too.


I am trying to include a signature with the email.
Unfortunately, the class doesnt have a method for signature.

I tried to send it along with the message body but I lose the line breaks and formatting.

Any help appreciated.
Thanks
 
Marshal
Posts: 26586
81
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That's because e-mail doesn't have "signature" as a concept. If you want some particular text to show up at the end of the body of an e-mail, then you should append that text to the body, just as you did there.

However it appears that your e-mail is formatted as HTML, based on the commented-out code. In which case your problem is merely that HTML treats new-line characters as spaces. If you want a line break you have to use <br> -- clearly you knew that already.

[Edit: Disable HTML in this message]
 
Viidhya Kishore
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Figured it out. I replaced all \r\n with <br> and it worked.

[Edit: Disable HTML in this message]
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic