I found how to create a Draft mail message in MSG format, I’d like to create an appointment request but I can’t see a way to do that. Appointment class requires all the parameters and there is no way to make such a MSG draft.
Hi Mariusz,
// create the appointment
app.Summary = “meeting request summary”;
app.Description = “description”;
// create the message and set the meeting request
MailMessage msg = new MailMessage();
msg.From = "from@aspose.com";
msg.To = "newcustomeronnet@gmail.com";
msg.TextBody = “Email Message detail”;
msg.Subject = “meeting request”;
msg.AddAlternateView(app.RequestApointment(0));
MapiMessage mapi = MapiMessage.FromMailMessage(msg);
mapi.SetMessageFlags(MapiMessageFlags.MSGFLAG_UNSENT);
mapi.Save(“AppDraft.msg”);
I already tried that, but it doesn’t open the msg file as Draft, but as a saved, not modifiable appointment. And I don’t want to provide any meeting details in that draft appointment request, I just need to create an empty draft appointment request with some attachments, so the user can open and and provide the details.
Hi Mariusz,
Please not that that concerns Java version. Can you let me know how can I track this issue? We plan to purchase Aspose Total in January, but we need to know the status of this by then as we need to let the customer know whether it is possible or not.
Hi Mariusz,
The issues you have found earlier (filed as NETWORKNET-33606) have been fixed in this update.
This message was posted using Notification2Forum from Downloads module by aspose.notifier.
What about Java version? I need that functionality in Java edition. Please let me know when it’s released and how to use it.
Hi Mariusz,
Hi Mariusz,
What if I don’t know the organizer and recipients? Can I leave the leave those two parameters empty?
Hi Mariusz,
Ah, so it doesn’t actually help it. When a draft appointment is generated I don’t know the recipients, the actual user which will open the appointment needs to fill it in. And the organizer is also not known, it depends how opens the draft.
I can see that no matter what organizer email is set, when I open the draft appointment it defaults to my account (as the provided organizer email may be not configured), so that is fine. The only enhancement I need in that case is a possibility of leaving recipients empty.
Hi Mariusz,
One more thing. How to add a line break inside the appoinment description? I tried “\n”, “\r\n” or even “
”, but it doesn’t work:(
Hi Mariusz,
Date startDate = new Date();
Date endDate = new Date();
message.setFrom(new MailAddress("FromUser@domain.com"));
MailAddressCollection attendees = new MailAddressCollection();
attendees.add("ToUser@domain.com");
message.setTo(attendees);
MailAddress organizer = null;
Appointment app = new Appointment(“Location name”, “my summary”, “description1\rdescription2\rdescription3”, startDate, endDate, organizer, attendees);
//Set the Appointment as Draft
app.setMethod(AppointmentMethodType.Publish);
message.addAlternateView(app.requestApointment());
MapiMessage mapiMsg = MapiMessage.fromMailMessage(message);
mapiMsg.save(“AppDraft2.msg”);
When I run this code from my PC it works fine, when I run it on my server I get a strange exception:
Hi Mariusz,
We are sorry for any inconvenience caused.
Can you please more details about your production environment, as I was unable to reproduce this issue at my end using the latest version of Aspose.Email for Java 2.7.0. Please provide complete information about your server, tomcat installed, and your application. It'll be of added benefit if you could provide us some test project to reproduce this issue at our end, as with my sample code I am unable to reproduce this issue. We'll look into these details and assist you further as soon as possbile.
Hi Mariusz,
message.addAlternateView(app.requestApointment());
MapiMessage msg = MapiMessage.fromMailMessage(message);
msg.getRecipients().clear();