Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Java mail outlook appointment issue

Reply
Thread Tools

Java mail outlook appointment issue

 
 
Pedro Pinto
Guest
Posts: n/a
 
      11-20-2007
Hi there to everyone!

I've been reseaching this topic. So far, the best efford for the
operation is:

Can send an e-mail with an outlook meeting request,
User receives e-mail with an attachment file, meeting.ics,
User can open and accept meeting and organizer receives read report
and acceptance,
User and Organizer cannot see the attendees of the meeting.

The issue, has described, is that the invitation is sent well but when
openning with Microsoft Outlook only the meeting organizer appears!
Does anyone knows how to solve this issue?

Thanks in advance.

Bellow goes the code.

-------------------------------

public class Mail {

/** Creates a new instance of Mail */
public Mail() {
}


public static void main(String[] args){

try{


MimetypesFileTypeMap mimetypes =
(MimetypesFileTypeMap)MimetypesFileTypeMap.getDefa ultFileTypeMap();
mimetypes.addMimeTypes("text/calendar ics ICS");

MailcapCommandMap mailcap =
(MailcapCommandMap)MailcapCommandMap.getDefaultCom mandMap();
mailcap.addMailcap("text/calendar;; x-java-content-
handler=com.sun.mail.handlers.text_plain");

//Calendar calendar = builder.build(fin);

String host = "xxx"; //Outbound mail address
String from = "(E-Mail Removed)";
String to = "(E-Mail Removed)";

// Get system properties
Properties props = System.getProperties();

// Setup mail server
props.put("mail.smtp.host", host);

// Get session
Session session = Session.getInstance(props, null);

// Define message
MimeMessage message = new MimeMessage(session);
message.addHeaderLine("method=REQUEST");
message.addHeaderLine("charset=UTF-8");
message.addHeaderLine("component=vevent");

message.setFrom(new InternetAddress(from));
//message.addRecipient(Message.RecipientType.TO, new
InternetAddress(to));
message.addRecipient(Message.RecipientType.TO, new
InternetAddress(from));
message.addRecipient(Message.RecipientType.TO, new
InternetAddress("(E-Mail Removed)"));
message.setSubject("Outlook Meeting Request Using
JavaMail");

StringBuffer sb = new StringBuffer();


StringBuffer buffer = sb.append("BEGIN:VCALENDAR\n" +
"PRODID:-//Microsoft Corporation//Outlook 11.0
MIMEDIR//EN\n" +
"VERSION:2.0\n" +
"METHOD:REQUEST\n" +
"BEGIN:VEVENT\n" +
"ATTENDEE;CN=\"xxx\";ROLE=REQ-
PARTICIPANT;RSVP=TRUE:MAILTO(E-Mail Removed)\ n"+
"ATTENDEE;CN=\"xxx\";ROLE=REQ-
PARTICIPANT;RSVP=TRUE:MAILTO(E-Mail Removed)\n"+
"ORGANIZER:MAILTO(E-Mail Removed)\n" +
"DTSTART:20071120T193000Z\n" +
"DTEND:20071120T200000Z\n" +
"LOCATION:Conference room\n" +
"TRANSP:OPAQUE\n" +
"SEQUENCE:0\n" +
"UID:
040000008200E00074C5B7101A82E00800000000002FF467CE 3AC5010000000000000000100\n"
+
" 000004377FE5C37984842BF9440448399EB02\n" +
"DTSTAMP:20071120T120102Z\n" +
"DESCRIPTION:This the description of the meeting.
\n" +
"SUMMARY:Test meeting request\n" +
"PRIORITY:5\n" +
"X-MICROSOFT-CDO-IMPORTANCE:1\n"+
"CLASSUBLIC\n" +
"BEGIN:VALARM\n" +
"TRIGGERT15M\n" +
"ACTIONISPLAY\n" +
"DESCRIPTION:Reminder\n" +
"END:VALARM\n" +
"END:VEVENT\n" +
"END:VCALENDAR");

// Create the message part
BodyPart messageBodyPart = new MimeBodyPart();
System.out.println(sb);
// Fill the message
messageBodyPart.setText("You are requested to participlate
in the review meeting.");

// Create a Multipart
Multipart multipart = new MimeMultipart();

// Add part one
multipart.addBodyPart(messageBodyPart);

// Part two is attachment
// Create second body part
messageBodyPart = new MimeBodyPart();
String filename = "invitation.ics";
messageBodyPart.setFileName(filename);
messageBodyPart.setHeader("Content-Class", "urn:content-
classes:calendarmessage");
messageBodyPart.setHeader("Content-
ID","calendar_message");
messageBodyPart.setContent(buffer.toString(), "text/
calendar");

// Add part two
multipart.addBodyPart(messageBodyPart);

// Put parts in message
message.setContent(multipart);

// send message
Transport.send(message);
} catch (MessagingException me) {
me.printStackTrace();
} catch (Exception ex) {
ex.printStackTrace();
}




}

}
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Code snippets to create Appointment in MS Outlook with win32olemodule Sean Nakasone Ruby 1 02-15-2008 02:25 AM
How do you send outlook appointment email? Akira ASP General 0 02-21-2005 11:45 PM
Create an Outlook Appointment chuckdfoster ASP .Net 6 12-22-2004 07:59 PM
Create outlook appointment - web form =?Utf-8?B?R2Vvcmdlcw==?= ASP .Net 0 08-04-2004 01:31 PM
Formatting an email to arrive as an appointment in Outlook Matt Moran ASP General 0 07-10-2003 05:51 PM



Advertisments