jQuery in Action, 3rd edition
The moose likes Java in General and the fly likes Email to include signature Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Email to include signature" Watch "Email to include signature" New topic

Email to include signature

Viidhya Kishore
Ranch Hand

Joined: Jan 03, 2007
Posts: 99

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.
Paul Clapham

Joined: Oct 14, 2005
Posts: 19869

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

Joined: Jan 03, 2007
Posts: 99
Figured it out. I replaced all \r\n with <br> and it worked.

[Edit: Disable HTML in this message]
I agree. Here's the link: http://aspose.com/file-tools
subject: Email to include signature
It's not a secret anymore!