Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Email to include signature

 
Viidhya Kishore
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • 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
 
Paul Clapham
Sheriff
Posts: 21322
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Figured it out. I replaced all \r\n with <br> and it worked.

[Edit: Disable HTML in this message]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic