Aspose.Email Outlook ile İlk Uygulama
Contents
[
Hide
]
Bu bölüm, Aspose.Email Mapi’nin nasıl kullanılacağını göstermektedir. Outlook mesaj dosyasını (TestMessage.msg) yükleyen ve konu, gönderici ve alıcı adreslerini ve gövde içeriğini gösteren küçük bir uygulama oluşturuyoruz. Aspose.Email Outlook kullanarak ilk uygulamanızı oluşturmak için şu adımları izleyin.
- Şunun bir örneğini oluştur MapiMessage mesaj dosyasının yolunu vererek sınıf.
- Konu, gönderen, alıcı ve gövdeyi göstermek için public özellikleri kullan.
Yukarıdaki adımların uygulanması aşağıdaki kod örneğinde gösterilmiştir.
// 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());
}