Aspose.Email Outlook을 사용한 첫 번째 애플리케이션

Contents
[ ]

이 섹션에서는 Aspose.Email Mapi 사용 방법을 보여줍니다. 우리는 Outlook 메시지 파일(TestMessage.msg)을 로드하고 제목, 발신자 및 수신자 주소와 본문 내용을 표시하는 작은 애플리케이션을 생성합니다. Aspose.Email Outlook을 사용해 첫 번째 애플리케이션을 만들려면 다음 단계를 따르세요.

  1. 다음의 인스턴스를 생성합니다. MapiMessage 메시지 파일 경로를 지정하는 클래스.
  2. 공용 속성을 사용하여 제목, 발신자, 수신자 및 본문을 표시합니다.

위 단계의 구현은 아래 코드 스니펫에서 보여줍니다.

// Load the outlook message file
MapiMessage msg = MapiMessage.fromFile("outlookmessage.msg");

// Use the public properties
//read subject
System.out.print("Subject:" + msg.getSubject());

//sender name
System.out.print("From:" + msg.getSenderName());

//message body
System.out.print("Body:" + msg.getBody());

//Attachments
for(MapiAttachment att : msg.getAttachments())
{
    System.out.print("Attachment Name:"+att.getFileName());
    att.save(att.getFileName());
}