c# download outlook msg file attachment
C#
Microsoft.Office.Interop.Outlook.Application oOutlookApp = new Microsoft.Office.Interop.Outlook.Application();
MailItem oMailItem = null;
oMailItem = oOutlookApp.CreateItemFromTemplate("e:\\test.msg");
Attachments oAttachments = oMailItem.Attachments;
for (int i = 1; i <= oAttachments.Count; i++)
{
Attachment oAttachment = oAttachments[i];
oAttachment.SaveAsFile(AppDomain.CurrentDomain.BaseDirectory + oAttachment.FileName);
Marshal.ReleaseComObject(oAttachment);
oAttachment = null;
}
Marshal.ReleaseComObject(oAttachments);
oAttachments = null;
Marshal.ReleaseComObject(oMailItem);
oMailItem = null;
oOutlookApp.Quit();
Marshal.ReleaseComObject(oOutlookApp);
oOutlookApp = null;
Also in C#:
- Title
- c sharp tryparse
- Category
- C#
- Title
- dynamic convert type c#
- Category
- C#
- Title
- unity instantiate an object
- Category
- C#
- Title
- eventos c#
- Category
- C#
- Title
- C# save pdf stream to file
- Category
- C#
- Title
- c# inotifypropertychanged best practices
- Category
- C#
- Title
- epplus excel vb.net
- Category
- C#
- Title
- html hidden text
- Category
- C#
- Title
- unity transfoprm position y change
- Category
- C#
- Title
- count the number of notes in a given amount c#
- Category
- C#
- Title
- cannot convert string to generic type c#
- Category
- C#
- Title
- dynamically add rows to datagridview c#
- Category
- C#
- Title
- binding c#
- Category
- C#
- Title
- never lose focus textbox c#
- Category
- C#
- Title
- C# get object property name
- Category
- C#
- Title
- choose random gameobject from a gameobject list
- Category
- C#
- Title
- c# xml file builder
- Category
- C#
- Title
- foreach syntax c#
- Category
- C#
- Title
- how to make an array in csharp
- Category
- C#
- Title
- how to reduce garbage collection c#
- Category
- C#
- Title
- unity how to change the text on a button
- Category
- C#
- Title
- declare string array c# without size
- Category
- C#
- Title
- c# print
- Category
- C#
- Title
- find gameobject with tag
- Category
- C#
- Title
- c# EncoderParameter
- Category
- C#
- Title
- convert array object to int[] c#
- Category
- C#
- Title
- unity quaternion
- Category
- C#
- Title
- compile in one single exe c#
- Category
- C#
- Title
- check if number is even or odd c#
- Category
- C#
- Title
- how to open new form on button click in c# xamarin
- Category
- C#
- Title
- copy a list in c# unity
- Category
- C#
- Title
- C# enum
- Category
- C#
- Title
- fahrenheit to celsius c#
- Category
- C#
- Title
- error CS0542
- Category
- C#
- Title
- .net core executenonqueryasync transaction
- Category
- C#
- Title
- center an image horizontally and vertically
- Category
- C#
- Title
- how to find a transform unity
- Category
- C#
- Title
- c# region tag
- Category
- C#
- Title
- bitmap to byte array c#
- Category
- C#
- Title
- change z value unity
- Category
- C#
- Title
- ihttpactionresult to object c#
- Category
- C#
- Title
- c# read file stream
- Category
- C#
- Title
- button commandfield commandargument pass textbox
- Category
- C#
- Title
- uwp file open picker
- Category
- C#
- Title
- unix time c#
- Category
- C#
- Title
- unity custom update
- Category
- C#
- Title
- get set c#
- Category
- C#
- Title
- automapper c# initialize error
- Category
- C#
- Title
- unity ui not seen
- Category
- C#
- Title
- take screenshot in c#
- Category
- C#
- Title
- rotation unity script 2d
- Category
- C#
- Title
- C# assigning image location
- Category
- C#
- Title
- set object to random color unity
- Category
- C#
- Title
- windows forms check if form is disposed
- Category
- C#
- Title
- c# check if type implements interface
- Category
- C#
- Title
- c# split a string and return list
- Category
- C#
- Title
- c# new dictionary linq
- Category
- C#
- Title
- snake game
- Category
- C#
- Title
- example HttpClient c# Post
- Category
- C#
- Title
- how to convert from hexadecimal to binary in c#
- Category
- C#
- Title
- font family behind code uwp c#
- Category
- C#
- Title
- unity c# set gameobject active
- Category
- C#
- Title
- unity set object scale
- Category
- C#
- Title
- c# update control from another thread
- Category
- C#
- Title
- iteration c#
- Category
- C#
- Title
- unity set sprite transparency
- Category
- C#
- Title
- unity rigidbody constraints
- Category
- C#
- Title
- unity line renderer position count
- Category
- C#
- Title
- how to get component in unity c#
- Category
- C#
- Title
- how to make % posibility to spawn an object C# in unity
- Category
- C#
- Title
- C# how to get public key for InternalsVisibleTo
- Category
- C#
- Title
- c# select first value from list
- Category
- C#
- Title
- movement script c#
- Category
- C#
- Title
- c# regex to find number between parenthesis
- Category
- C#
- Title
- transform.Translate movement
- Category
- C#
- Title
- in unity i want to destroy a gameobject when it hits the edge of the screen
- Category
- C#
- Title
- c# list append
- Category
- C#
- Title
- c# catch two exceptions in one block
- Category
- C#
- Title
- check if network is available c#
- Category
- C#
- Title
- define enum c#
- Category
- C#
- Title
- 2d object look at object
- Category
- C#
- Title
- odbc command parameters c#
- Category
- C#
- Title
- Unity C# add slider into editor
- Category
- C#
- Title
- bundle.config in mvc is missing
- Category
- C#
- Title
- c# string to memorystream
- Category
- C#
- Title
- how to close a form c#
- Category
- C#
- Title
- unity up arrow input
- Category
- C#
- Title
- unity rb.addexplosionforce 2d
- Category
- C#
- Title
- linq foreach c#
- Category
- C#
- Title
- visual studio C# hintergrund bild ändern
- Category
- C#
- Title
- call Textboxfor in cs
- Category
- C#
- Title
- change textbox location C#
- Category
- C#
- Title
- c# try catch error
- Category
- C#
- Title
- C# resize window without title bar
- Category
- C#
- Title
- check connection c#
- Category
- C#
- Title
- what does gameobject.find return
- Category
- C#
- Title
- c# array isn't working
- Category
- C#
- Title
- c sharp if string equals
- Category
- C#
- Title
- unity create a child object
- Category
- C#
- Title
- file picker uwp c#
- Category
- C#