File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Email to include signature" Watch "Email to include signature" New topic
Author

Email to include signature

Viidhya Kishore
Ranch Hand

Joined: Jan 03, 2007
Posts: 99
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
Bartender

Joined: Oct 14, 2005
Posts: 18708
    
    8

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]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Email to include signature