Outlook msg file create

by Kulin 10. August 2009 01:52

Creating a new Outlook .msg file programmatically in C#

[code:c#]

// Creates a new Outlook Application Instance
Outlook.Application objOutlook = new Outlook.Application();

// Creating a new Outlook Message from the Outlook Application Instance
Outlook.MailItem mic = (Outlook.MailItem)(objOutlook.CreateItem(Outlook.OlItemType.olMailItem));

// Assigns the "TO", "CC" and "BCC" Fields
mic.To = toTextBox.Text;
mic.CC = ccTextBox.Text;
mic.BCC = bccTextBox.Text;

// Assigns the Subject Field
mic.Subject = subjectTextBox.Text;

// Switch the Importance ComboBox to identify the Mail Message Importance Level
switch (importanceComboBox.SelectedItem.ToString())
{
        case "High":
                mic.Importance = Outlook.OlImportance.olImportanceHigh;
                break;         case "Normal":
                mic.Importance = Outlook.OlImportance.olImportanceNormal;
                break;

        case "Low":
                mic.Importance = Outlook.OlImportance.olImportanceLow;
                break;
}

// Define the Mail Message Body. In this example, you can add in HTML content to the mail message body
mic.HTMLBody = messageTextBox.Text;

// Adds Attachment to the Mail Message.
// Note: You could add more than one attachment to the mail message.
// All you need to do is to declare this relative to the number of attachments you have.
mic.Attachments.Add(attachmentOneTextBox.Text,Outlook.OlAttachmentType.olByValue,1,"Attachment Name");

// Save the message to C:\demo.msg. Alternatively you can create a SaveFileDialog to
// allow users to choose where to save the file
mic.SaveAs(@"C:\demo.msg", Outlook.OlSaveAsType.olMSG);

[/code]

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , , ,

programming

Microsoft !exploitable Security Analyzer released

by Kulin 22. March 2009 09:21

The Microsoft Security Engineering Center ('MSEC') has released an open source tool called the !exploitable Security Analyzer (pronounced 'bang exploitable') to detect and analyze security and crashes within software projects while they are in development. Designed around the familiar People-Processes-Technology frame of reference, !exploitable has been designed as a Windows Debugger (Windbg) extension and works on a rule-based engine to parse out and categorize crash dumps for further investigation.

Slides are also available for those interested in delving further into the gory details.

Currently rated 2.0 by 1 people

  • Currently 2/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

programming | Software

Powered by BlogEngine.NET 1.4.5.0 | Theme by Mads Kristensen
Page loaded in 0.031202 seconds.

Disclaimer

The opinions reflected on this blog are entirely my own, and do not reflect the thoughts and/or opinions of my employer in any way.