สร้างคำขอการนัดหมายแบบร่าง

Aspose.Email - สร้างคำขอการนัดหมายแบบร่าง

การสร้างคำขอนัดหมายในโหมดร่างอาจเป็นประโยชน์ เพื่อให้ข้อมูลพื้นฐานถูกเพิ่มและร่างการนัดหมายนั้นสามารถส่งต่อไปยังผู้ใช้คนอื่นที่อาจทำการแก้ไขได้ Aspose.Email สำหรับ Java ให้ความยืดหยุ่นในการสร้างและบันทึกการนัดหมายในโหมดร่างเพื่อใช้ในภายหลัง

เพื่อบันทึกการนัดหมายในโหมดร่าง ค่าคุณสมบัติ Method ของคลาส Appointment ควรตั้งเป็น 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 จากไซต์โซเชียลโค้ดดิ้งใด ๆ ที่กล่าวถึงด้านล่าง: