Flex 4 coltware airxmail - send vCal appointment
I am using coltware.airxmail to send emails from my Flex app.
I would like to send VCalendar appointment files generated from Flex straight to Outlook so they are opened in the Calender view. I am able to send the VCal files as an attachment on an email, however, these are not "auto-opened" in Outlook Calendar, which requires the user to double click on the file.
I have been trying to set the content type of the mail to "text/x-vCalendar", and pass in a byte array containing the VCal file, however, no joy. The vCal arrives as a .txt attachment to an empty email!
I wonder if anyone has had previous experience with this kit, or can suggest any pointers?
Or even suggest another component they have used to send VCal files straight to outlook, from ActionScript?
Here's my sample code (DEMO CODE VERY MESSY JUST TO GET POINT ACROSS):
var sender:SMTPSender = new SMTPSender();
// Set the from / to / host / port values herevar contentType:ContentType = new ContentType();
contentType.setMainType("text/x-vCalendar");
var message:MimeMessage = new MimeMessage(contentType,"UTF-8");
var file:File = File.desktopDirectory.resolvePath("vcal.vcs");
file.addEventListener(Event.COMPLETE, function(ev:Event):void {
message.addRawContent(file.data); sender.send(message); sender.close();
});
file.load();
H开发者_如何学Goopefully I can achieve this using the coltware component. There's nothing on their site about using these methods, although the API guide is very incomplete - just "basic usage"... http://code.google.com/p/airxmail/wiki/HowToUseAPI
Did you try using a different content type, such as "text/calendar"? see here: http://weblogs.asp.net/bradvincent/archive/2008/01/16/creating-vcalendars-programmatically.aspx
精彩评论