내 Lotus Notes 전자 메일을 하드 드라이브로 내보내 (저장)해야합니다. 첨부 파일을 HDD에 저장하는 방법을 알아 냈지만 전체 전자 메일을 저장하는 방법을 이해할 수는 없습니다.Lotus Notes - 전체 전자 메일 메시지 저장 eml C#
아래 코드는 첨부 파일을 내보내는 방법을 보여줍니다. 이메일을 저장하기 위해 어떻게 수정할 수 있습니까? PS- 프로그래밍 초보자입니다. Bob Babalan에 의해
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Domino;
using System.Collections;
namespace ExportLotusAttachments
{
class Class1
{
public void ScanForEmails()
{
String textBox1 = "c:\\1";
NotesSession session = new NotesSession();
session.Initialize("");
NotesDbDirectory dir = null;
dir = session.GetDbDirectory("");
NotesDatabase db = null;
db = dir.OpenMailDatabase();
NotesDatabase NDb = dir.OpenMailDatabase(); //Database connection
//ArrayList that will hold names of the folders
ArrayList LotusViews2 = new ArrayList();
foreach (NotesView V in NDb.Views)
{
if (V.IsFolder && !(V.Name.Equals("($All)")))
{
NotesView getS = V;
LotusViews2.Add(getS.Name);
}
}
foreach (String obj in LotusViews2)
{
NotesDocument NDoc;
NotesView nInboxDocs = NDb.GetView(obj);
NDoc = nInboxDocs.GetFirstDocument();
String pAttachment;
while (NDoc != null)
{
if (NDoc.HasEmbedded && NDoc.HasItem("$File"))
{
object[] AllDocItems = (object[])NDoc.Items;
foreach (object CurItem in AllDocItems)
{
NotesItem nItem = (NotesItem)CurItem;
if (IT_TYPE.ATTACHMENT == nItem.type)
{
String path = textBox1;
pAttachment = ((object[])nItem.Values)[0].ToString();
if (!System.IO.Directory.Exists(path))
{
System.IO.Directory.CreateDirectory(textBox1);
}
try
{
NDoc.GetAttachment(pAttachment).ExtractFile(@path + pAttachment);
}
catch { }
}
}
}
NDoc = nInboxDocs.GetNextDocument(NDoc);
}
}
}
}
}
게시하기 전에 서식을 지정하기 위해 코드를 미리 보시기 바랍니다. 입력 한 영역 아래를 보면이 코드를 미리 볼 수 있습니다. 그것은 당신의 질문을 더 가독하게 만들뿐만 아니라, 다른 사람들이 그것을 고쳐야하기 때문에 시간을 절약 할 수 있습니다. :) 사람들이 읽고 이해하는 것이 더 쉬울수록 더 많은 대답을 얻을 수 있습니다. 감사. –