ドラフト予定リクエストを作成

Aspose.Email - ドラフト予定リクエストの作成

ドラフトモードで予定リクエストを作成すると、基本情報を追加した後、そのドラフト予定を変更可能な他のユーザーに転送できます。Aspose.Email for Java は、後で使用できるようにドラフトモードで予定を作成・保存する柔軟性を提供します。

予定をドラフトモードで保存するには、Appointment クラスの Method プロパティを Publish に設定する必要があります。

Java


 String sender = "test@gmail.com";

String recipient = "test@email.com";

MailMessage message = new MailMessage(sender, recipient, "", "");

Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("GMT"));

calendar.set(2012, Calendar.NOVEMBER, 1, 0, 0, 0);

Date startDate = calendar.getTime();

calendar.set(2012, Calendar.DECEMBER, 1);

Date endDate = calendar.getTime();

MailAddressCollection attendees = new MailAddressCollection();

attendees.addMailAddress(new MailAddress("attendee_address@aspose.com", "Attendee"));

WeeklyRecurrencePattern expected = new WeeklyRecurrencePattern(3);

Appointment app = new Appointment("Appointment Location", "Appointment Summary", "Appointment Description",

        startDate, endDate,

        new MailAddress("organizer_address@aspose.com", "Organizer"), attendees, expected);

//Set the Appointment as Draft

app.setMethod(AppointmentMethodType.Publish);//.Method = AppointmentMethodType.Publish;

message.addAlternateView(app.requestApointment());

MapiMessage msg = MapiMessage.fromMailMessage(message);

// Save the appointment as draft.

msg.save("data/AsposeDraft.msg");

実行コードをダウンロード

以下のソーシャルコーディングサイトから Create Draft Appointment Request をダウンロードしてください: