How to send Meeting Request invitations to Outlook with JavaMail

Wednesday, February 11, 2009 10:28 AM Posted by Valer Micle
Labels:

I was searching for documentations on how to send an Outlook Meeting request with JavaMail and unfortunately I didn't found any reliable solution.
What I want to obtain is to have an e-mail sent from my client which in Outlook will be displayed like a normal meeting invitation (with Accept/Tentative/Decline buttons).
Finally, after reading a lot of forums and spamming my own inbox with hundreds of e-mails, I've managed to get it working. Here are the steps that you will need to follow: 
  1. Register the text/calendar mime-type as a mime-type file type: 
  2. //register the text/calendar mime type
        MimetypesFileTypeMap mimetypes = (MimetypesFileTypeMap)MimetypesFileTypeMap.getDefaultFileTypeMap();
        mimetypes.addMimeTypes("text/calendar ics ICS");
    
  3. Register the activation handling of the text/calendar mime-type:
  4. //register the handling of text/calendar mime type
        MailcapCommandMap mailcap = (MailcapCommandMap) MailcapCommandMap.getDefaultCommandMap();
        mailcap.addMailcap("text/calendar;; x-java-content-handler=com.sun.mail.handlers.text_plain");
    
  5. Start building a MimeMessage. Note: The sender will be read by Outlook as being the organizer, the TO recipients will be considered the required participants and the CC recipients will be considered the optional recipients. (Here Outlook doesn't respect the iCalendar spec.. but what can we do…)
  6. MimeMessage message = new MimeMessage(session);
        message.setFrom(new InternetAddress(from));
        message.setSubject(subject);
        message.addRecipient(Message.RecipientType.TO, new InternetAddress(recipient));
    
  7. Start building an alternative MimeMultipart
  8. // Create an alternative Multipart
        Multipart multipart = new MimeMultipart("alternative");
    
  9. Build the first body part, a simple text/html content and add it to the mimeMultipart
  10. //part 1, html text
        BodyPart messageBodyPart = buildHtmlTextPart();
        multipart.addBodyPart(messageBodyPart);
    
  11. Build the second part bodyPart, the calendar one and add it to the MimeMultipart
    1. The following header needs to be added to this part: "Content-Class" - "urn:content-classes:calendarmessage"
    2. The content type needs to be set to: "text/calendar;method=REQUEST"
    3. DO NOT set a filename for this part. This is very important in order to have Outlook properly reading the email
    // Add part two, the calendar
        BodyPart calendarPart = buildCalendarPart();
        multipart.addBodyPart(calendarPart);
    
  12. Set the content of your MimeMessage to be the MimeMultipart and send it.
  13. //Put the multipart in message 
        message.setContent(multipart);
    
        // send the message
        Transport transport = session.getTransport("smtp");
        transport.connect();
        transport.sendMessage(message, message.getAllRecipients());
        transport.close();
    

Here are the two methods that are used to build the text/html part and the calendar part:
private BodyPart buildHtmlTextPart() throws MessagingException {

        MimeBodyPart descriptionPart = new MimeBodyPart();

        //Note: even if the content is spcified as being text/html, outlook won't read correctly tables at all
        // and only some properties from div:s. Thus, try to avoid too fancy content
        String content = "simple meeting invitation";
        descriptionPart.setContent(content, "text/html; charset=utf-8");

        return descriptionPart;
    }

    //define somewhere the icalendar date format
    private static SimpleDateFormat iCalendarDateFormat = new SimpleDateFormat("yyyyMMdd'T'HHmm'00'");

    private BodyPart buildCalendarPart() throws Exception {

        BodyPart calendarPart = new MimeBodyPart();

        Calendar cal = Calendar.getInstance();
        cal.add(Calendar.DAY_OF_MONTH, 1);
        Date start = cal.getTime();
        cal.add(Calendar.HOUR_OF_DAY, 3);
        Date end = cal.getTime();

        //check the icalendar spec in order to build a more complicated meeting request
        String calendarContent =
                "BEGIN:VCALENDAR\n" +
                        "METHOD:REQUEST\n" +
                        "PRODID: BCP - Meeting\n" +
                        "VERSION:2.0\n" +
                        "BEGIN:VEVENT\n" +
                        "DTSTAMP:" + iCalendarDateFormat.format(start) + "\n" +
                        "DTSTART:" + iCalendarDateFormat.format(start)+ "\n" +
                        "DTEND:"  + iCalendarDateFormat.format(end)+ "\n" +
                        "SUMMARY:test request\n" +
                        "UID:324\n" +
                        "ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE:MAILTO:organizer@yahoo.com\n" +
                        "ORGANIZER:MAILTO:organizer@yahoo.com\n" +
                        "LOCATION:on the net\n" +
                        "DESCRIPTION:learn some stuff\n" +
                        "SEQUENCE:0\n" +
                        "PRIORITY:5\n" +
                        "CLASS:PUBLIC\n" +
                        "STATUS:CONFIRMED\n" +
                        "TRANSP:OPAQUE\n" +
                        "BEGIN:VALARM\n" +
                        "ACTION:DISPLAY\n" +
                        "DESCRIPTION:REMINDER\n" +
                        "TRIGGER;RELATED=START:-PT00H15M00S\n" +
                        "END:VALARM\n" +
                        "END:VEVENT\n" +
                        "END:VCALENDAR";

        calendarPart.addHeader("Content-Class", "urn:content-classes:calendarmessage");
        calendarPart.setContent(calendarContent, "text/calendar;method=CANCEL");

        return calendarPart;
    }



That's all folks. This has been tested in Feb 2009 and it works perfectly. If you have questions, don't hesitate to ask them ;) 
Cheers

Comments (80)

Nice. Can you please however provide the full implementation on how this can be done? Thanks

The full code was added. Enjoy it

Do you have similar code for Outlook tasks?

Nope.. sorry. But I think it should be pretty similar as with the meetings.

If you got it working, maybe you can share your solution with us :)

Hey, i tried the code. but in my outlook the meeting time is different than what i have passed.I tried by setting Timezone, but no success.
Can you please help me....
Thanks

Hi,

So the e-mail is ok and the only problem is the time seen in meeting request?
Pls have a look at the ICalendar spec, it will give you an idea on what are the correct data that needs to be passed in in order to have the meeting displayed ok. (take it as a guideline because outlook is not respecting the spec)

Also make sure that the format of the time is the one I've specified: yyyyMMdd'T'HHmm'00'
You should obtain an output for 11/02/2010 12:28 looking like this: 20100211T122800

Here are the details that were added in my example with some explanations:
METHOD - REQUEST/CANCEL
DTSTAMP - the creation date of the event
DTSTART - the start date of the event
DTEND - the end date of the event
UID - the ID of the event used to identify an event for further updates (if you want to modify/cancel a meeting, simply send one more request with the same ID and with the other fields updated)

If the problem persists, please post the calendar content string tougether with the expected date in outlook and I'll have a look.

I had a problem with the meeting time.
I added a call to set the timezone.

iCalendarDateFormat.setTimeZone(TimeZone.getTimeZone("Z"));

I cannot seem to get the meetings to delete from outlook using METHOD:CANCEL. Cancelling just seems to update the meeting...

Hi there. If you send a meeting invitation with the method:cancel, you will receive an e-mail in the inbox which shows exactly like a meeting cancellation sent from outlook (a calendar with a red cross on it).

When you click on it, you will have a button 'Remove from calendar'. That is the standard behaviour of meetings in outlook.

Just pay attention that the meeting cancellation email is built with the same UID as the meeting that you want to cancel. Outlook identifies the meeting that you want to cancel based on the UID that you pass in. So if you sent your meeting request with UID: 123, then any new meeting request on the meeting with UID: 123 will bee seen by outlook as an update. If you send a meeting:cancel for the meeting with UID:123 it will be seen by outlook as a meeting cancelation for that specific meeting.

Hi. Thanks for the response. I think I also had to set 'STATUS:CANCELLED'
The 'Remove from calendar' button now appears.
Previously I received the meeting cancellation email, but it had buttons to Accept/Decline the invitation instead of the Remove option.

Thanks once again

Excellent piece of code. Works like a charm

Hi,

I am able to send meeting request mail ...
but now i want to send task mail.
Can anybody please help me,how to send a task request mail through mail...

Hi,
I tried the code and it works pretty fine in sending meeting requests. Thanks for sharing. However I am having one issue that the meeting is not showing up in the main calendar of organizer. It is showing up fine in attendees calendars. Can you please provide any info regarding how we can update organizer's calendar with the meeting created.

Hi guys,

Sorry for my late reply, I wasn't around for a while :)

Regarding the update of the organizer's calendar with the meeting created, the only way I managed to get it working it was to send the meeting invitation also to the organizer. Pay attention on setting the organizer correctly on the icalendar invitation in order for the organizer to appear correctly displayed (as organizer and not as a simple attendee)

It appeared ok in the organizer's calendar, but I was not able to manage the schedules of the meeting as for a meeting created in Outlook. If you manage to create the meeting so that also the manage of schedules to be manageable, please let me know.

Vandana said on February 11, 2010 10:27 AM
Hey, i tried the code. but in my outlook the meeting time is different than what i have passed.I tried by setting Timezone, but no success.
Can you please help me....
Thanks

Pritesh
Hi,
I tried setting
iCalendarDateFormat.setTimeZone(TimeZone.getTimeZone("Z")); but the time i am expecting is different than what i am getting in outlook.
i am passing this date iCalendarDateFormat.format(start)20100421T183000

and in outlook i am getting Thursday, April 22, 2010 4:00 AM-7:00 AM.

Please help me out for this prob as its really urgent for me.
Thanks in advance

Hi,

Please post the iCalendar message that you are sending part of the e-mail.
From what you said I can not understand directly why this is happening.
Thanks

Hi, the code worked perfect. Thank you so much for posting this blog. It saved me a lot of time. I am working on sending Outlook tasks from Java. Once complete, I will post my code here as well. Thanks again

Hi,

Excellent blog, and I can get it to work in Outlook 2002, but when the ics attachment is opened in Outlook 2003 or 2007 the Accept/Tentative/Decline/ buttons are greyed out and no action can be done on it. Opening a copy of that same file directly from the file system however works perfectly, so the problem can't be with the content. Any ideas? Many thanks ... Neil Richards

Hi,

I also need to send a meeting invite through Java Code.Right now it is goin as an ICS file attched in the mail but meeting time is not correct if request is sent anywhere outside ST.My server for sending the same is in EST. Can anyone please correct this code or tell me the problem?

public static int create_meeting_request(String month,String day,String year,String start_hour,String start_min,String start_sec,String end_hour, String end_min,String end_sec,String description, String attendee,String location, String request_no,String ppmfilename)
{
TimeZoneRegistry registry = TimeZoneRegistryFactory.getInstance().createRegistry();
TimeZone timezone = registry.getTimeZone("US/Eastern");
VTimeZone tz = timezone.getVTimeZone();

String temp_string=ppmfilename;
System.out.println("Temp_string:"+temp_string);

Calendar startDate = new GregorianCalendar();
startDate.setTimeZone(timezone);
startDate.set(java.util.Calendar.MONTH,Integer.parseInt(month.substring(5,7)) -1 );
startDate.set(java.util.Calendar.DAY_OF_MONTH,Integer.parseInt(day.substring(8,10)));
startDate.set(java.util.Calendar.YEAR, Integer.parseInt(year.substring(0,4)));
startDate.set(java.util.Calendar.HOUR_OF_DAY, Integer.parseInt(start_hour.substring(11,13)));
startDate.set(java.util.Calendar.MINUTE,Integer.parseInt(start_min.substring(14,16)));
startDate.set(java.util.Calendar.SECOND, Integer.parseInt(start_sec.substring(17,19)));

// system.out.println(args[0]);
//String temp_month = substring(6,7);

Calendar endDate = new GregorianCalendar();
endDate.setTimeZone(timezone);
endDate.set(java.util.Calendar.MONTH, Integer.parseInt(month.substring(5,7))-1);
endDate.set(java.util.Calendar.DAY_OF_MONTH, Integer.parseInt(day.substring(8,10)));
endDate.set(java.util.Calendar.YEAR, Integer.parseInt(year.substring(0,4)));
endDate.set(java.util.Calendar.HOUR_OF_DAY, Integer.parseInt(end_hour.substring(11,13)));
endDate.set(java.util.Calendar.MINUTE, Integer.parseInt(end_min.substring(14,16)));
endDate.set(java.util.Calendar.SECOND, Integer.parseInt(end_sec.substring(17,19)));


// Create the event
String eventName = "COMPLIANCE REVIEW";
DateTime start = new DateTime(startDate.getTime());
DateTime end = new DateTime(endDate.getTime());
VEvent meeting = new VEvent(start, end, eventName);


VAlarm reminder = new VAlarm(new Dur(0, -1, 0, 0));
reminder.getProperties().add(new Repeat(4));
reminder.getProperties().add(new Duration(new Dur(0, 0, 15, 0)));
reminder.getProperties().add(Action.DISPLAY);
reminder.getProperties().add(new Description(description));


// add timezone info..
meeting.getProperties().add(tz.getTimeZoneId());

// generate unique identifier for meeting request..
UidGenerator ug = null;
try {
ug = new UidGenerator("uidGen");
} catch (SocketException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Uid uid = ug.generateUid();
meeting.getProperties().add(uid);
/*******************************************************************/


int arraysize=0;



String temp_attendee = new String(attendee);
String [] attendee_list = temp_attendee.split("; ");



for ( int i = 0; i < temp_attendee.length(); i++ ) {
if ( ",".indexOf(temp_attendee.charAt(i) ) != -1 )
arraysize++;
}

//----Code Continues----
//System.out.println("Attendee1:"+ attendee_list[0]);
//System.out.println("Attendee2:"+ attendee_list[1]);



/**********************************************************************/

// add attendees to the meeting request

for (int i=0 ;i<attendee_list.length;i++)
{

Attendee dev1 = new Attendee(URI.create("MAILTO:" +attendee_list[i]));
dev1.getParameters().add(Rsvp.TRUE);
dev1.getParameters().add(Role.REQ_PARTICIPANT);
dev1.getParameters().add(new Cn("Developer "+i));
meeting.getProperties().add(dev1);
//System.out.println(attendee_list[i]);
}





//Description
meeting.getProperties().add(new Description(description));

meeting.getAlarms().add(reminder);

// Create a calendar
net.fortuna.ical4j.model.Calendar icsCalendar = new net.fortuna.ical4j.model.Calendar();
icsCalendar.getProperties().add(new ProdId("-//Microsoft Corporation//Outlook 11.0 MIMEDIR//EN"));
icsCalendar.getProperties().add(Method.REQUEST);
icsCalendar.getProperties().add(Version.VERSION_2_0);

//Organizer
Organizer org1 = new Organizer(URI.create("MAILTO:compliance.review@genworth.com"));
org1.getParameters().add(new Cn("Compliance Review"));
meeting.getProperties().add(org1);
meeting.getAlarms().add(reminder);

Location loc1 = new Location(location);
meeting.getProperties().add(loc1);

// Add the event and print the file
icsCalendar.getComponents().add(meeting);
System.out.println(icsCalendar);

//File file = new File("/apps/ppmtest/Genworth_Calendar/ICS_Files/bslcalendar_para.ics");

File file = new File(temp_string);

try {
FileOutputStream fout = new FileOutputStream(file);

CalendarOutputter outputter = new CalendarOutputter(false);
outputter.output(icsCalendar, fout);
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (ValidationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return(0);

}
}

Parmeters I am passing:
"2010-06-21 00:00:00.0" "2010-06-21 00:00:00.0" "2010-06-21 00:00:00.0" "2010-06-21 09:20:00.0" "2010-06-21 09:20:00.0" "2010-06-21 09:20:00.0" "2010-06-21 09:40:00.0" "2010-06-21 09:40:00.0" "2010-06-21 09:40:00.0" "Test text" "abc@xxx.com" "Location for Meeting" "51623" "calendar_para51623.ics"

Also, do you have any idea of directly sending the meeting request instead of ics attachment.I am sure my client would love to have that.

Thanks,
Richa

This comment has been removed by the author.

Hi,

The code is working fine. But Iam facing one problem like first time I am sending one meeting invite to one person and next time I am sending another meeting invite to the same person for different date. If second invite date is future than the first invite date, the first invite is deleted from the person's calender and second invite is updating... please look into this issue and let me know any have some ideas.

Hi,
I am using the following code to send email to multiple recipients:
InternetAddress[] toAddress = new InternetAddress[to.length];
for (int i = 0; i < to.length; i++){
toAddress[i] = new InternetAddress(to[i]);}

My mail is showing Email addresses instead of Display Names.Can anyone help me in how to show Display names?

How to send special characters like ½, Ê as part of the calendar body? We are using microsoft outlook, and the incoming messages having these special characters are not getting displayed...i am using VCALENDAR 2.0, and the description encoding is "QUOTED-PRINTABLE" and it has the limitation of up to ASCII 127. I am able to see these characters for my receiving messages if it comes as an html body with ISO-8859-1 charset.

Hi,

thks for this post. Nice example!

by the way, it's not work properly on google calendar, at leas for me.

Did you try in google calendar??

Is there a way to make an event show as "Busy" automatically for the attendee without them having to "Accept" the appointment? I tried setting the following properties:

"ATTENDEE;ROLE=REQ-PARTICIPANT;RSVP=FALSE;PARTSTAT=ACCEPTED:MAILTO:email@someplace.com"
"STATUS:CONFIRMED"

Is there something else I need to do to have an appointment show up in the attendees calendar as busy without them having to accept the appointment?

Awesome. I love technical blogs for this reason. Saves helluva time avoiding reinventing the wheel :)

Thanks a bunch Valer!

Thanks for your nice post, Valer. I'm looking for your full code, can you upload again? or can you send to my email: ngtrungkien@gmail.com ?

Thanks so much!

Hi, did anyone get anywhere with sending tasks?

Thanks in advance, Paul.

Good piece of work.
Thanks a lot,
Lal

This works great for me.

Finally I found the solution.

thx

I came across a specific issue. This implementation is working perfectly, with most of smtp servers we have. but is not working in a specific customer's environment. The Meeting Request Showing Up As Text Emails. And even that is coming as an attachment and I cannot see organizer properly and I cannot see Accept / Tentative / Decline buttons.

Any ideas?

Hi,

Thanks for this excellent post.

I got it work well as per my requirement, but i am facing a little issue with cancellation of recurring event.

Creation & Updation is working fine, cancel when sent to cancel whole meeting is working fine, but when i use the cancel on particular day of a recurring event its not handling it will

Below is the iCalendar struture an generating

BEGIN:VCALENDAR
METHOD:CANCEL
PRODID: Testing - Meet
VERSION:2.0
BEGIN:VEVENT
DTSTAMP:20110125T102200Z
DTSTART:20110201T053000Z
DTEND:20110201T063000Z
SUMMARY:Event AAA
TZID:Asia/Calcutta
UID:Project 3_79375Event_70829
ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE:MAILTO:Vinay Kortikere
ORGANIZER:MAILTO:Vinay Kortikere
RRULE:FREQ=DAILY;UNTIL=20110211T235900Z
LOCATION:ssssssss
DESCRIPTION:Event AAA
RECURRENCE-ID:20110204T053000Z
SEQUENCE:1
PRIORITY:5
CLASS:PUBLIC
TRANSP:OPAQUE
BEGIN:VALARM
ACTION:DISPLAY
DESCRIPTION:REMINDER
TRIGGER;RELATED=START:-PT00H15M00S
END:VALARM
END:VEVENT
END:VCALENDAR

Can you please provide your inputs on this?

Thanks in advance.

Vinay Kortikere

Hi Valer,

Thanks for sharing this bug-free code that works flawlessly.
I need to create code that reads Outlook Calendar meetings/appointments & displays it on the page.

Can you please help me in achieving this?
Would be great if you can mail me on the same, with some good idea, at sunnycatchme@gmail.com

Hi Valer,

I really appreciate this article. I am admittedly lazy and I am wondering if you could post full source that I can use as a reference? I notice you mention that full code has been posted but I could not locate it :-(

Please could you re-post?

Best regards
Ashish

Hi Valer,

I can't see the link to the full code either...

Cheers,
Pat

What if I want to put a table in meeting request? Because it is showing the data in plain format though I am using table tag

Excellent, thanks

This implementation is not working perfectly, with one of smtp servers we have. The Meeting Request Showing Up As Text Emails. And even that is coming as an attachment and I cannot see organizer properly and I cannot see Accept / Tentative / Decline buttons. Help me out in this if you have any idea

i want to access yahoo calendar to set and get meeting detail please give me sample code for the same


Email id : lonamike84@yahoo.com

Sending Tasks assignments would be awesome. If someone has that solved, please post. Thanks

That really helped

Thanks man ;)

HI
Thanks for the Code !..Its working fine for me,But i want to replay action for acceptance or decline mail after the user accept the meeting or decline it!...

thanks in advance by
Mohan

Dear Valer...I've implimented the code and it workk absolutely fine... I've an another quesy.. is it possible to attach files with the same calendar invitation. I'm in urgent neeed of the solution for my problem. Pls suggest....

Did anyone ever get the time issue resolved and if so how did you do it?

I'm generating the time like this:


SimpleDateFormat iCalendarDateFormat = new SimpleDateFormat("yyyyMMdd'T'HHmm'00'");
iCalendarDateFormat.setTimeZone(TimeZone.getTimeZone("Z"));

Calendar calStart = Calendar.getInstance();
calStart.set(Calendar.DAY_OF_MONTH, 12);
calStart.set(Calendar.MONTH, Calendar.APRIL);
calStart.set(Calendar.HOUR, 4);
calStart.set(Calendar.MINUTE, 0);

System.out.println("Month = " + calStart.get(Calendar.MONTH));

System.out.println("DAY OF MONTH = " + calStart.get(Calendar.DAY_OF_MONTH));
System.out.println("Hour = " + calStart.get(Calendar.HOUR));
System.out.println("Minute = " + calStart.get(Calendar.MINUTE));

Date start = calStart.getTime();


Calendar calEnd = Calendar.getInstance();
calEnd.set(Calendar.DAY_OF_MONTH, 12);
calEnd.set(Calendar.MONTH, Calendar.APRIL);
calEnd.set(Calendar.HOUR, 5);
calEnd.set(Calendar.MINUTE, 0);

Date end = calEnd.getTime();

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:ss@sso.com\n"
+ "ORGANIZER:MAILTO:ss@ss.com\n"
+ "DTSTART:" + iCalendarDateFormat.format(start) + "\n"
+ "DTEND:" + iCalendarDateFormat.format(end) + "\n"
+ "LOCATION:Space Station\n"
+ "TRANSP:OPAQUE\n"
+ "SEQUENCE:0\n"
+ "UID:20120412T223913Z-48455@flypig.co.uk\n"
+ "DTSTAMP:" + iCalendarDateFormat.format(start) + "\n"
+ "CATEGORIES:Meeting\n"
+ "DESCRIPTION:JAVA MEETING 6.\n\n"
+ "SUMMARY:THIS MAY WORK\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");

I must thank you for the efforts you've put in writing this website. I really hope to check out the same high-grade content from you in the future as well. In fact, your creative writing abilities has inspired me to get my own, personal website now ;)
Also visit my blog post - Here

Is there something similar avaliable in Grails/groovy....I tried inventing some code.. but couldnt get through...and also the mail should go as a meeting Request, not as an attachment(.ics)...

I just ran into the same timezone issue and found the TZID solutions didn't work. What I eventually did was set my formatter to UTC. When I open the ICS locally, I see my local time just fine.

SimpleDateFormat iCalendarDateFormat = new SimpleDateFormat("yyyyMMdd'T'HHmm'00'")

iCalendarDateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));

Hi, thanks, very useful post.
I want to ask, am i right:

You do not add Accept,Tentative, Decline buttons manually? Right?

You add ics and the receiver application(outlook, gmail, zimbra) understand it, did i undertsand right?

hi,
your code works fine. nice post. but how to enable accept,tentative,decline buttons with user response.

DT

Hi,
For the file name for meeting request, we are giving filename.ics.
But for the tasks, what is the file extension? any help ??

MR

> how to enable accept,tentative,decline buttons

RSVP=TRUE parameter in ATTENDEE should enable the buttons.

Very informative, Thanks for sharing, But I came across another java email component by the name of Aspose.Email for Java. It enables Java applications to read and write MS Outlook MSG files from within a Java application without using MS Outlook. I am sure it will be helpful

Really very informative. Excellent. Thanks

where is the complete code ?? can u share the Link

HI
I tried UR code It's working absolutely fine in web mail(zimbra) but if i download that email in outlook meeting request shows as attachment file with email & not as meeting invite so kindly help me for same Thanks for U r code

Does any body have the solution for sending Tasks?
Or is it not possible?

Thanks for any answer!

Okay, they call it VTODO´s. But they will not supported by outlook. So it seems so that there is no possibility to generate a task

Can I send two meeting invitation in a single mail

Hi Thanks for the code. It is working fine for me except having Timezone issue. Problem is meeting invite send from Brisbane to India user is getting same time as Brisbane in Calendar. Instead of that India user should get time converted into IST timezone.

Any help would be really appreciated. Thanks.

Please help me Below code(JAVA) is not working as it is showing Not Support in outlook

String calendarContent =
"BEGIN:VCALENDAR\n" +
"METHOD:REQUEST\n" +
"PRODID: BCP - Meeting\n" +
"VERSION:2.0\n" +
"BEGIN:VEVENT\n" +
"DTSTAMP:" + iCalendarDateFormat.format(start) + "\n" +
"DTSTART;TZID=Australia/Sydney:"+ iCalendarDateFormat.format(start)+ "\n" +
iCalendarDateFormat.format(end)+ "\n" +
"TZID:Australia/Sydney\n" +
"SUMMARY:"+meetingSchedule.getName()+"\n" +
"UID:"+meetingSchedule.getId()+"\n" +
setTo.toString()+
"ORGANIZER:MAILTO:"+from+"\n" +
"LOCATION:" +meetingSchedule.getLocation()+"\n"+
"DESCRIPTION:"+meetingSchedule.getAgenda()+"\n" +
"SEQUENCE:0\n" +
"PRIORITY:5\n" +
"CLASS:PUBLIC\n" +
"STATUS:CONFIRMED\n" +
"TRANSP:OPAQUE\n" +
"BEGIN:VALARM\n" +
"ACTION:DISPLAY\n" +
"DESCRIPTION:REMINDER\n" +
"TRIGGER;RELATED=START:-PT00H15M00S\n" +
"END:VALARM\n" +


"END:VEVENT\n" +

Please help me Below code(JAVA) is not working as it is showing Not Support in outlook


String calendarContent =
"BEGIN:VCALENDAR\n" +
"METHOD:REQUEST\n" +
"PRODID: BCP - Meeting\n" +
"VERSION:2.0\n" +
"BEGIN:VEVENT\n" +
"DTSTAMP:" + iCalendarDateFormat.format(start) + "\n" +
"DTSTART;TZID=Australia/Sydney:"+
iCalendarDateFormat.format(start)+ "\n" +
"DTEND;TZID=Australia/Sydney:" + iCalendarDateFormat.format(end)+ "\n" +
"TZID:Australia/Sydney\n" +
"SUMMARY:"+meetingSchedule.getName()+"\n" +
"UID:"+meetingSchedule.getId()+"\n" +
setTo.toString()+
"ORGANIZER:MAILTO:"+from+"\n" +
"LOCATION:" +meetingSchedule.getLocation()+"\n"+
"DESCRIPTION:"+meetingSchedule.getAgenda()+"\n" +
"SEQUENCE:0\n" +
"PRIORITY:5\n" +
"CLASS:PUBLIC\n" +
"STATUS:CONFIRMED\n" +
"TRANSP:OPAQUE\n" +
"BEGIN:VALARM\n" +
"ACTION:DISPLAY\n" +
"DESCRIPTION:REMINDER\n" +
"TRIGGER;RELATED=START:-PT00H15M00S\n" +
"END:VALARM\n" +


"END:VEVENT\n" +


/* " BEGIN:VTIMEZONE"
+ "TZID:America/Los_Angeles"
+ "BEGIN:DAYLIGHT"
+ "TZOFFSETFROM:-0800"
+ "TZOFFSETTO:-0700"
+ "TZNAME:PDT"
+ "DTSTART:19700308T020000"
+ "RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=2SU"
+ "END:DAYLIGHT"
+ "BEGIN:STANDARD"
+ "TZOFFSETFROM:-0700"
+ "TZOFFSETTO:-0800"
+ "TZNAME:PST"
+ "DTSTART:19701101T020000"
+ "RRULE:FREQ=YEARLY;BYMONTH=11;BYDAY=1SU"
+ "END:STANDARD"
+ "END:VTIMEZONE"
*/

"END:VCALENDAR";

Please, Where can I get the full code? Is it available to work with last versions of Outlock?

Thanks,

I am facing problem with UTF-8 chars, (Euro chars)..
how to tackle with them?

Thanks A lot
Very helpful

Hi,

process is clear and working perfectly .

Thank you.

This code is working for me but When I am changing The organizer to any other then mail is going as simple attachment. Can you help me for dynamic organizer. I am using zimbra mail not outlook.

Hi Sir,

Could you please provide me the full code.

thanks


The code is working fine. But Iam facing one problem like first time I am sending one meeting invite to one person and next time I am sending another meeting invite to the same person for different date. If second invite date is future than the first invite date, the first invite is deleted from the person's calender and second invite is updating... please look into this issue... Many Thanks, Raj...

hi

Really very informative. Excellent.
I want to send google/outlook calendar meeting request. I am able to send outlook calendar request but in google this is shown as attachment not as a meeting request. Please help me regarding google request.

Nice article. Seems ical4j doesn't sends Accept/Decline notifications from Invitees to Organizer. Anyone know about it.

Hi
can i get sample full code implementation of calendar invites with accept/decline i tried but mail sends as a attachement of ics without accept/decline

Hi
When i open the calendar invite in outlook 2016, it shows the invite as a attachment and i had to click and open the attachment to get that event added to calendar. But in outlook 2017, calendar invite shows as a inline message in outlook. Do you have any idea how to fix this in outlook 2016

very good article
NBFC Software


I really enjoyed your blog Thanks for sharing such an informative post.
https://www.login4ites.com/
https://myseokhazana.com/

Thanks for sahring fill code.
AllCloud is Loan Management Software uses cutting edge technology which automates the process for quick loan approval.
Loan Origination system
NBFC Software

Hi how to set IST time that too a particular date i want to sent..
Please please help me..

This post is still a godsend 11 years later.

Fun facts:
- You can replace the entire calendar string with the .ics content from a meeting invite created in Outlook. It should also handle time zones, and you can build an elaborate body in the meeting to market your event.
- It seems it is necessary to remove the first body part, the html text, in order to get the meeting request to show properly in Outlook.
-Do not also attach the .ics file.

Also make sure you change the method=CANCEL to method=REQUEST when setting the content type, if you're copying this code directly.

Thanks man, this works even in 2021. You saved some valuable time for me

Hi
With increasing automation and the introduction of Straight Through Processing of loan applications, it is necessary for a lending institution to have control over its policies.

Digitalization has the potential to change this completely. It makes the commercial loan origination process primarily automated, requiring human intervention only when cognitive decisions are to be made. While digital commercial loan origination has been around as a concept for a while now, two trends have propelled its recent popularity.
I want to suggest a page about loan origination systems it is useful to your audience plz check out

loan origination system
thank you for the page

Post a Comment