1
String textEmail= "Hi, \n this is an automatic message \n from sender.    
StringBuffer buffer = sb.append("BEGIN:VCALENDAR\n" +
                "PRODID:-//Microsoft Corporation//Outlook 9.0 MIMEDIR//EN\n" +
                "VERSION:2.0\n" +
                "METHOD:REQUEST\n" +
                "BEGIN:VEVENT\n" +
                "ATTENDEE;ROLE=REQ-PARTICIPANT;RSVP=TRUE:MAILTO:" +emailAdressTo+"\n" +
                "ORGANIZER:MAILTO:XX@gmail.com\n" +
                "DTSTART:" + meetingStartTime + "\n"+
                "DTEND:" + meetingEndTime + "\n"+
                "LOCATION: Room FR PAR-New York\n" +
                "TRANSP:OPAQUE\n" +
                "SEQUENCE:0\n" +
                "UID:"+ uniqueId +"\n" +
                "DTSTAMP:"+ meetingEndTime + "\n" +
                "CATEGORIES:Meeting\n" +
                "DESCRIPTION:"+textEmail +"\n" +
                "SUMMARY:"+subjectEmail+"\n" +
                "PRIORITY:5\n" +
                "CLASS:PUBLIC\n" +
                "BEGIN:VALARM\n" +
                "TRIGGER:PT1440M\n" +
                "ACTION:DISPLAY\n" +
                "DESCRIPTION:Reminder\n" +
                "END:VALARM\n" +
                "END:VEVENT\n" +
                "END:VCALENDAR");
email.setContent(buffer.toString(),"text/calendar");
        email.setCharset("UTF-8");

the linebreaks breaks are not taken in consideration and my output is just:

"Hi,this is an automatic message from sender"

I have tried every think in this post: [1]How do I format a String in an email so Outlook will print the line breaks? but still same result Any help would be apreciated, thks

  • List item
Community
  • 1
  • 1
devstudo
  • 11
  • 2
  • 1
    Possible duplicate of [How do I format a String in an email so Outlook will print the line breaks?](http://stackoverflow.com/questions/136052/how-do-i-format-a-string-in-an-email-so-outlook-will-print-the-line-breaks) – Ryan Waskiewicz Jun 14 '16 at 10:25
  • already tried it ! didn't work. May be because my content type is text/calendar – devstudo Jun 14 '16 at 10:31
  • Can you do what you want using Outlook directly? If so, look at the message it creates to see how it does it. Also, perhaps you need \r\n instead of just \n? – Bill Shannon Jun 14 '16 at 17:13

0 Answers0