在java中发送会议请求outlook,在"描述中发送换行符:"被拿走了

时间:2016-06-14 10:18:31

标签: java outlook javamail line-breaks

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");

不考虑换行符,我的输出只是:

"Hi,this is an automatic message from sender"

我在这篇文章中尝试过每一个想法: [1] How do I format a String in an email so Outlook will print the line breaks?但仍然是相同的结果任何帮助都是apreciated,thks

  • 列表项

0 个答案:

没有答案