이메일 내보내기

VSTO

다음은 VSTO Outlook을 사용하여 이메일을 내보내는 코드입니다.


  string FilePath = @"E:\Aspose\Aspose VS VSTO\Sample Files\ExportEmail.msg";

 // Create Application class and get namespace

 Outlook.Application outlook = new Outlook.Application();

 Outlook.NameSpace ns = outlook.GetNamespace("Mapi");

 object _missing = Type.Missing;

 ns.Logon(_missing, _missing, false, true);

 // Get Inbox information in objec of type MAPIFolder

 Outlook.MAPIFolder inbox = ns.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox);

 Outlook.MailItem item = inbox.Items[0];

 item.SaveAs(FilePath,_missing);       

Aspose.Email

다음은 Aspose.Email for .NET을 사용하여 이메일을 내보내는 코드입니다.


  string FilePath = @"E:\Aspose\Aspose VS VSTO\Sample Files\ExportEmail.msg";

 //Create an instance of the MailMessage class

 MailMessage msg = new MailMessage();

 //Export to MHT format

 msg.Save(FilePath, SaveOptions.DefaultMsg);

소스 코드 다운로드

실행 예제 다운로드