code_junkie

I am losing periods in an email sent using Java Mail

Nov 11th, 2011
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. Please print your <a href=3D"http://xxxxxxx.xxx.xx.edu=
  2. au//newsletter2/3/InnovExpoInviteVIP.pdf"> VIP invitation</a> for future re=
  3. ference and check the Innovation Expo website <a href=3D"http://xxxxxxx.xx=
  4. xx.xx.edu.au/2008/"> xxxxxxx.xxxx.xx.edu.au</a> for updates.
  5.  
  6. private String mimeEncode (String input)
  7. {
  8. ByteArrayOutputStream bOut = new ByteArrayOutputStream();
  9. OutputStream out;
  10. try
  11. {
  12. out = MimeUtility.encode( bOut, "quoted-printable" );
  13. out.write( input.getBytes( ) );
  14. out.flush( );
  15. out.close( );
  16. bOut.close( );
  17. } catch (MessagingException e)
  18. {
  19. log.error( "Encoding error occured:",e );
  20. return input;
  21. } catch (IOException e)
  22. {
  23. log.error( "Encoding error occured:",e );
  24. return input;
  25. }
  26.  
  27. return bOut.toString( );
  28. }
  29.  
  30. BodyPart bp = new MimeBodyPart();
  31. bp.setContent(message,"text/html");
  32.  
  33. var html;
  34. html = "Blah Blah Blah Blah ";
  35. html = html & " More Text Here....";
  36.  
  37. var html;
  38. html = "Blah Blah Blah Blah " & VbCrLf;
  39. html = html & " More Text Here....";
Add Comment
Please, Sign In to add comment