Using CDO : CDO « Network « C# / C Sharp

Home
C# / C Sharp
1.2D Graphics
2.Class Interface
3.Collections Data Structure
4.Components
5.Data Types
6.Database ADO.net
7.Date Time
8.Design Patterns
9.Development Class
10.Event
11.File Stream
12.Generics
13.GUI Windows Form
14.Internationalization I18N
15.Language Basics
16.LINQ
17.Network
18.Office
19.Reflection
20.Regular Expressions
21.Security
22.Services Event
23.Thread
24.Web Services
25.Windows
26.Windows Presentation Foundation
27.XML
28.XML LINQ
C# Book
C# / C Sharp by API
C# / CSharp Tutorial
C# / CSharp Open Source
C# / C Sharp » Network » CDOScreenshots 
Using CDO

/*
 * C# Programmers Pocket Consultant
 * Author: Gregory S. MacBeth
 * Email: [email protected]
 * Create Date: June 27, 2003
 * Last Modified Date:
 * Version: 1
 */
using System;
using CDO;
using ADODB;


namespace Client.Chapter_19___Office_Integration
{
  public class UsingCDOEx
  {
    static void Main(string[] args)
    {
      Message MyMessage = new MessageClass();
      Configuration MyConfig = MyMessage.Configuration;
      Fields MyFields = MyConfig.Fields;

      MyFields[@"http://schemas.microsoft.com/cdo/configuration/sendusing"].Value = 2;
      MyFields[@"http://schemas.microsoft.com/cdo/configuration/smtpserverport"].Value = 25;
      MyFields[@"http://schemas.microsoft.com/cdo/configuration/smtpserver"].Value = "smarthost";
      MyFields.Update();
      MyMessage.Configuration = MyConfig;
      MyMessage.TextBody = "This is a test message";
      MyMessage.Subject = "Testing";
      MyMessage.From = "[email protected]";
      MyMessage.To = "[email protected]";
      MyMessage.Send();
    }
  }

}

           
       
Related examples in the same category
w_w__w__._j__a___v___a2s_._c_o_m__ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.