Welcome to MSDN Blogs Sign in | Join | Help

Le Café Central de DeVa

DeVa's Developer Messaging blog!!

News

  • <font color="WHITE">Le Café Central de DeVa</font> DeVa rocks!!

    My XBOX Live

    XBox Live

    Disclaimer:
    This weblog/blog is solely my opinion.The information in this weblog/blog is provided "AS IS" with no warranties, and confers no rights. This weblog/blog does not represent the thoughts, intentions, plans or strategies of my employer. Inappropriate comments will be deleted at the authors discretion.

    Use of included script samples are subject to the terms specified in the Terms of Use
    .

    Privacy Statement:
    I do not collect personal data associated with comments posted to this site.


    Translate into your language

    Site Statistics
    Locations of visitors to this page






    Make a difference


    Subscription offer


    Developer resources



    Students free software

    Try & Test Drive Online

    More about Windows 7
    Download
    Virtual Roundtable with Mark Add to Calendar

    Experiences

    Go Green!!



CDOEXM & C#.Net : How to mail-disable public folders in Exchange Server 2003 SP2 – Native Mode?

I created this code snippet, which helps us to mail-disable in the Exchange Server 2003 SP2 (Native mode) – public folders. For this i tried this, i used C#.Net & CDOEXM. In this below code, i try to mail-disable the public folder named “publicfolder1”. I used Visual Studio.Net 2008, C#.Net and CDOEXM – Collaboration Data Objects for Exchange Management – 2003 to do this:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CDO;
using CDOEXM;
using System.Collections; 
namespace MailDisableCSharp
{
    class Program
    {
        static void Main(string[] args)
        { 
 
            try
            {
                CDO.Folder objFolder = new CDO.Folder();
                CDOEXM.IMailRecipient objRecip;
                string fullurl;
                fullurl = "http://domain/public/publicfolder1";
 
                objFolder.DataSource.Open(
                                fullurl,
                                null,
                                ADODB.ConnectModeEnum.adModeReadWrite,
                                ADODB.RecordCreateOptionsEnum.adFailIfNotExists,
                                ADODB.RecordOpenOptionsEnum.adOpenExecuteCommand,
                                "Administrator",
                                "Password"); 
 
                objRecip = (CDOEXM.IMailRecipient)objFolder;
                objRecip.MailDisable();
                objFolder.DataSource.Save();
                Console.Write("Success");
             }
            catch (Exception e1)
            {
                Console.WriteLine(e1.Message);
           } 
 
        }
    }
}

Note:

+ To execute this code, you may try with VS.Net 2005 or VS.Net 2008, C#.Net.
+ Make sure you need to use the following references: CDOEXM – Microsoft CDO for Exchange Management 2000 & CDOEX - Microsoft CDO for Exchange 2000.
+ This code helps us to mail-disable the public folder “public folder1”.
+ Also we need to make sure to pass valid credentials username(Administrator) & password(Password) to execute this, along with valid fullURL – the public folder needs to be mail-disabled & domain – exchange domain.

Hope this helps. Happy programming!!

How to & Webcast : Working with Microsoft Office Outlook 2007 categories and flags

Hey, i found this webcast, which can help us to use the Outlook 2007 categories and flags.

During this Support WebCast we will provide information about Microsoft Office Outlook 2007. Specifically, we will provide the following information:

  • List the goals of the design improvements made to flags
  • List ways to apply flags to various items Outlook 2007
  • Discuss the enhancements made to the category functions in Outlook 2007
  • List the different ways to assign categories to items in Outlook
  • Manage categories and use the Most Recently Used list options
  • Explain the ways that categories are displayed in module views
  • Understand backward compatibility issues related to the new category functionality

This is a Level 100 (http://support.microsoft.com/default.aspx?scid=gp;en-us;webcastlevels&sd=gn) session that was recorded Wednesday, 25 April 2007 and presented by Audey Teeter. Audey Teeter is a graduate of the Middle Tennessee State University at Murfreesboro, TN, where he received a Bachelor of Science degree. He has worked for Microsoft for more than six years. Audey started out as a support engineer for Microsoft Office Setup and later Microsoft Word. He has progressed through the roles of mentor and partner technical lead, and has also been a beta engineer for Office 2003 Common Components. Audey is a Partner Technical Lead for Office Setup, Outlook, Business Contact Manager, and Outlook Express. He is currently involved in the Microsoft Office 12 beta.

Viewing the Presentation

View this Support
		  WebCastTo view, please click on the link: View this Support WebCast (https://www.livemeeting.com/cc/msevents/view?id=wc042507)  (Length: 1 hour 0 minutes)
This Windows Streaming Media archive requires an Internet connection of 56 Kbps or faster, and is best viewed with a minimum screen resolution of 800 X 600.

OfflineOffline viewing download (http://download.microsoft.com/download/a/d/1/ad1af678-2742-4bec-85a6-388c54e30f20/wc042507.wmv.zip ) - If you wish to download a copy of this broadcast to your local hard drive for off-line viewing, we provide this as a separate file (self-extracting .exe) that you can download.
Podcasting/Mobile Resources

Audio-Only - WMAAudio-Only Stream (.WMA format) (http://download.microsoft.com/download/a/d/1/ad1af678-2742-4bec-85a6-388c54e30f20/wc042507.wma.zip ) - Click this link if you wish to listen to an audio-only version of this broadcast in WMA (Windows Media Audio) streaming format.

Audio-Only - MP3Audio-Only Stream (.MP3 format) (http://download.microsoft.com/download/a/d/1/ad1af678-2742-4bec-85a6-388c54e30f20/wc042507.mp3.zip ) - Click this link if you wish to listen to an audio-only version of this broadcast in MP3 (MPEG Audio) format.

Additional Resources

PPT Download the presentation (http://download.microsoft.com/download/a/d/1/ad1af678-2742-4bec-85a6-388c54e30f20/wc042507.zip ) - This is a Microsoft PowerPoint (.ppt) file.
If you do not have PowerPoint and you want a copy of the slides, please use the PowerPoint Viewer (http://www.microsoft.com/downloads/details.aspx?FamilyID=428d5727-43ab-4f24-90b7-a94784af71a4&DisplayLang=en) (1,911 KB).

Transcript Read the Transcript from this event (http://download.microsoft.com/download/a/d/1/ad1af678-2742-4bec-85a6-388c54e30f20/wct042507.zip )

Happy learning!!

General : Do you know what is “ReadyBoost” technology ?

ReadyBoost technology takes advantage of the fact that flash memory offers lower seek times than hard disks. Essentially that means that your system can get to a given location on a flash disk more quickly than it can to a corresponding spot on a hard disk. Hard disks are faster for large sequential reads; flash disks are quicker for small, random reads. When a supported external memory device is available, ReadyBoost caches small chunks in flash memory and is thus able to retrieve those chunks, when needed, more quickly than it could if it relied only on the hard disk.

Because an external memory device can be removed without warning to the system, all data cached via ReadyBoost is encrypted and backed up on the hard disk (as well as being compressed). Encryption ensures that the data can’t be read on another system, and backup enables Windows to revert to the hard disk cache in the event that the ReadyBoost drive is removed.

Windows supports the following form factors for ReadyBoost:

•USB 2.0 flash disks

•Secure Digital (SD) cards

•CompactFlash cards

When you connect a device of one of these types to your system, Windows runs a quick performance test to see if the device meets minimum standards required for ReadyBoost. Those standards are:

•2.5 MB / second throughout for 4 KB random reads

•1.75 MB / second throughout for 512 KB random writes

In addition, the device must have at least 256 MB available for the ReadyBoost cache.

Note: ReadyBoost does not support external card readers. If Windows Explorer shows a volume letter for a drive without media (as it does, for example, for card-reader drives or floppy drives), inserting flash media for that volume letter will not give you a ReadyBoost drive. In addition, Windows Vista does not support multiple ReadyBoost drives. (Microsoft has indicated that multiple-drive support is under consideration for future versions.)

How much boost will you get from ReadyBoost?
As with so many other performance issues, it depends. If your internal memory is well above the amount you actually need, ReadyBoost won’t do much for you. If not, you should definitely see some performance improvement. To use ReadyBoost, follow these steps:

1. Plug a suitable external memory device into your computer. An AutoPlay window similar to the following will appear (it won’t say READYBOOST, unless you’ve already assigned that name to the volume, as we have here):

Picture of AutoPlay dialog box showing ReadyBoost drive

This window appears when you plug a ReadyBoost-compatible memory device into your computer

2. Click Speed up my system. If your system passes an initial ReadyBoost test, the Properties dialog box will appear, with the ReadyBoost tab selected:

ReadyBoost properties

Use the slider to set aside space on your memory device for ReadyBoost

•Select Use this device, and then adjust the slider to specify the amount of space you want to use for ReadyBoost. Then click OK.

How much of the external memory device you want to assign to ReadyBoost will depend on whether you also want to use the device for ordinary storage. Microsoft estimates that you can benefit from a ReadyBoost cache equal to approximately 150 percent of your system RAM—for example, a 1.5 GB ReadyBoost cache on a 1 GB systems.

Reference info:
=============
http://windowshelp.microsoft.com/Windows/en-US/help/596fb57f-cc9d-4ac5-a813-5c0830e9156a1033.mspx
Windows Vista Inside Out by Ed Bott, Carl Siechert, and Craig Stinson (Windows Vista Inside Out © 2007 Microsoft Corporation. To learn more about this book, visit the Microsoft Learning website.)

Error Code : List of ASP Error Codes & its description

When i was searching for Classic ASP (not ASP.Net) related error code, i found the related information. Please find the list of ASP error codes that may be returned while an Active Server Pages (ASP) page is processing. This may vary depending on the version of Internet Information Services (IIS) that you use. This applies to IIS 3.0, 4.0, 5.0 & 6.0.

ASP error code

Description

ASP 0100

Out of memory

ASP 0101

Unexpected error

ASP 0102

Expecting string input

ASP 0103

Expecting numeric input

ASP 0104

Operation not Allowed

ASP 0105

Index out of range

ASP 0106

Type Mismatch

ASP 0107

Stack Overflow

ASP 0108

Create object failed

ASP 0109

Member not found

ASP 0110

Unknown name

ASP 0111

Unknown interface

ASP 0112

Missing parameter

ASP 0113

Script timed out

ASP 0114

Object not free threaded

ASP 0115

Unexpected error

ASP 0116

Missing close of script delimiter

ASP 0117

Missing close of script tag

ASP 0118

Missing close of object tag

ASP 0119

Missing Classid or Progid attribute

ASP 0120

Invalid Runat attribute

ASP 0121

Invalid Scope in object tag

ASP 0122

Invalid Scope in object tag

ASP 0123

Missing Id attribute

ASP 0124

Missing Language attribute

ASP 0125

Missing close of attribute

ASP 0126

Include file not found

ASP 0127

Missing close of HTML comment

ASP 0128

Missing File or Virtual attribute

ASP 0129

Unknown scripting language

ASP 0130

Invalid File attribute

ASP 0131

Disallowed Parent Path

ASP 0132

Compilation Error

ASP 0133

Invalid ClassID attribute

ASP 0134

Invalid ProgID attribute

ASP 0135

Cyclic Include

ASP 0136

Invalid object instance name

ASP 0137

Invalid Global Script

ASP 0138

Nested Script Block

ASP 0139

Nested Object

ASP 0140

Page Command Out Of Order

ASP 0141

Page Command Repeated

ASP 0142

Thread token error

ASP 0143

Invalid Application Name

ASP 0144

Initialization Error

ASP 0145

New Application Failed

ASP 0146

New Session Failed

ASP 0147

500 Server Error

ASP 0148

Server Too Busy

ASP 0149

Application Restarting

ASP 0150

Application Directory Error

ASP 0151

Change Notification Error

ASP 0152

Security Error

ASP 0153

Thread Error

ASP 0154

Write HTTP Header Error

ASP 0155

Write Page Content Error

ASP 0156

Header Error

ASP 0157

Buffering On

ASP 0158

Missing URL

ASP 0159

Buffering Off

ASP 0160

Logging Failure

ASP 0161

Data Type Error

ASP 0162

Cannot Modify Cookie

ASP 0163

Invalid Comma Use

ASP 0164

Invalid TimeOut Value

ASP 0165

SessionID Error

ASP 0166

Uninitialized Object

ASP 0167

Session Initialization Error

ASP 0168

Disallowed object use

ASP 0169

Missing object information

ASP 0170

Delete Session Error

ASP 0171

Missing Path

ASP 0172

Invalid Path

ASP 0173

Invalid Path Character

ASP 0174

Invalid Path Character(s)

ASP 0175

Disallowed Path Characters

ASP 0176

Path Not Found

ASP 0177

Server.CreateObject Failed

ASP 0178

Server.CreateObject Access Error

ASP 0179

Application Initialization Error

ASP 0180

Disallowed object use

ASP 0181

Invalid threading model

ASP 0182

Missing object information

ASP 0183

Empty Cookie Key

ASP 0184

Missing Cookie Name

ASP 0185

Missing Default Property

ASP 0186

Error parsing certificate

ASP 0187

Object addition conflict

ASP 0188

Disallowed object use

ASP 0189

Disallowed object use

ASP 0190

Unexpected error

ASP 0191

Unexpected error

ASP 0192

Unexpected error

ASP 0193

OnStartPage Failed

ASP 0194

OnEndPage Failed

ASP 0195

Invalid Server Method Call

ASP 0196

Cannot launch out of process component

ASP 0197

Disallowed object use

ASP 0198

Server shutting down

ASP 0199

Disallowed object use

ASP 0200

Out of Range 'Expires' attribute

ASP 0201

Invalid Default Script Language

ASP 0202

Missing Code Page

ASP 0203

Invalid Code Page

ASP 0204

Invalid CodePage Value

ASP 0205

Change Notification

ASP 0206

Cannot call BinaryRead

ASP 0207

Cannot use Request.Form

ASP 0208

Cannot use generic Request collection

ASP 0209

Illegal value for TRANSACTION property

ASP 0210

Method not implemented

ASP 0211

Object out of scope

ASP 0212

Cannot Clear Buffer

ASP 0214

Invalid Path parameter

ASP 0215

Illegal value for ENABLESESSIONSTATE property

ASP 0216

MSDTC Service not running

ASP 0217

Invalid Scope in object tag

ASP 0218

Missing LCID

ASP 0219

Invalid LCID

ASP 0220

Requests for GLOBAL.ASA Not Allowed

ASP 0221

Invalid @ Command directive

ASP 0222

Invalid TypeLib Specification

ASP 0223

TypeLib Not Found

ASP 0224

Cannot load TypeLib

ASP 0225

Cannot wrap TypeLibs

ASP 0226

Cannot modify StaticObjects

ASP 0227

Server.Execute Failed

ASP 0228

Server.Execute Error

ASP 0229

Server.Transfer Failed

ASP 0230

Server.Transfer Error

ASP 0231

Server.Execute Error

ASP 0232

Invalid Cookie Specification

ASP 0233

Cannot load cookie script source

ASP 0234

Invalid include directive

ASP 0235

Server.Transfer Error

ASP 0236

Invalid Cookie Specification

ASP 0237

Invalid Cookie Specification

ASP 0238

Missing attribute value

ASP 0239

Cannot process file

ASP 0240

Script Engine Exception

ASP 0241

CreateObject Exception

ASP 0242

Query OnStartPage Interface Exception

ASP 0243

Invalid METADATA tag in Global.asa

ASP 0244

Cannot Enable Session State

ASP 0245

Mixed usage of Code Page values

ASP 0246

Too many concurrent users. Please try again later.

ASP 0247

Bad Argument to BinaryRead.

ASP 0248

Script isn't transacted. This ASP file must be transacted in order to use the ObjectContext object.

ASP 0249

Cannot use IStream on Request. Cannot use IStream on Request object after using Request.Form collection or Request.BinaryRead.

ASP 0250

Invalid Default Code Page. The default code page specified for this application is invalid.

ASP 0251

Response Buffer Limit Exceeded. Execution of the ASP page caused the Response Buffer to exceed its configured limit.

Outlook Object Model : Creating Outlook Categories programmatically and assign colors, shortcut keys to that

In this blogpost, we will try to create the Outlook Categories programmatically using Outlook Object Model API. Also we will assign the relevant colors and shortcuts to that. Whenever we try with Outlook Object Model, it’s relatively simple.

'[Code snippet to create Categories]
Private Sub CreateCategory()
 
    Dim objNameSpace As NameSpace
    Dim objCategory As Category    
  
    ' Obtain a NameSpace object reference
    Set objNameSpace = Application.GetNamespace("MAPI")
    'Add the Category, set its color and shortcutkey, if any
    Set objCategory = objNameSpace.Categories.Add("SampleCat", OlCategoryColor.olCategoryColorDarkBlue, 
_OlCategoryShortcutKey.olCategoryShortcutKeyNone)
   
   ' Clean up
    Set objCategory = Nothing
    Set objNameSpace = Nothing
    
End Sub
 
Happy programming!!
Outlook Object Model : Creating simple tasks programmatically using OOM & VBA?

In this post, we will create the simple Outlook tasks programmatically using Outlook Object Model API & VBA. We do this by using the code snippet:

'[Code Snippet for creating Simple Tasks using Outlook Object Model API & VBA]
 
Private Sub CreateTasks()
    
    'Declare the Task item
    Dim objTask As TaskItem
 
    ' Create Outlook Task item
    Set objTask = Application.CreateItem(olTaskItem)
    
    'Define its values
    objTask.Subject = "Test Item"
    objTask.Body = "Test task item"
    objTask.Importance = olImportanceNormal
    objTask.Status = olTaskNotStarted
    objTask.NoAging = True
    'Save the task
    objTask.Save
    MsgBox "Task Created"
      
    ' Clean up.
    Set objTask = Nothing
       
End Sub
Download: Standalone Microsoft Exchange Server 2007 Service Pack 1 Help

The Exchange Server 2007 SP1 Help can help you in the day-to-day administration of Exchange. Use this information to guide you through Exchange Server 2007 SP1 features, tasks, and administration procedures. This download contains a standalone version of Microsoft Exchange Server 2007 SP1 Help.

Note: The self extractor default install location is C:\Program Files\Microsoft\Exchange Server\Bin. To view the most recent version of the Help file within Exchange Server, be sure to extract the Help file (exchhelp.chm) to the folder where the Help file is currently installed. You can search your local drive to find the location where the Help file is installed (typically C:\Program Files\Microsoft\Exchange Server\Bin).

Download : Windows API code pack for .Net Framework

The Code Pack is a source-code library that provides access to the new Windows 7 features (and some related Windows Vista features) from managed code. These features are not available to developers today in the .NET Framework. Minimum .NET Framework version required to use this library is 3.5.

The individual features supported in this version (v0.90) of the library are:

  • Windows 7 Taskbar Jump Lists, Icon Overlay, Progress Bar, Tabbed Thumbnails, and Thumbnail Toolbars.
  • Known Folders, Windows 7 Libraries, non-file system containers, and a hierarchy of Shell Namespace entities.
  • Windows 7 Explorer Browser Control.
  • Shell property system.
  • Windows Vista and Windows 7 Common File Dialogs, including custom controls.
  • Windows Vista and Windows 7 Task Dialogs.
  • Direct3D 11.0, Direct3D 10.1/10.0, DXGI 1.0/1.1, Direct2D 1.0, DirectWrite, Windows Imaging Component (WIC) APIs. (DirectWrite and WIC have partial support)
  • Sensor Platform APIs
  • Extended Linguistic Services APIs
  • Power Management APIs
  • Application Restart and Recovery APIs
  • Network List Manager APIs
  • Command Link control and System defined Shell icons.

What’s New in this update (v0.90):
The new features added in this update of code pack are:
  • Tabbed Thumbnail and Thumbnail Toolbar features in Taskbar area.
  • Direct3D 10.1/10.0, Direct2D 1.0, DirectWrite and WIC APIs in the DirectX area
  • Power Management
  • Application Restart and Recovery
  • Command Link
  • System defined Shell icons
  • Network List Manager APIs
Other enhancements done in this update are:
  • Bug fixes in all areas.
  • Many new and improved samples.
  • Addition of VB.NET samples in some areas.

Happy programming!!

Windows Mobile : Windows Mobile 6.5 Developer Tool Kit available

If you’re a Windows Mobile developer, then this is for you.

While this has been a much-awaited release for the developer community, some confusion has arisen in the media. To clarify, the Windows Mobile 6.5 Developer Tool Kit (DTK) is not an SDK. The DTK contains emulators, gesture APIs, and samples useful for developing Windows Mobile 6.5 applications (both Standard & Professional Emulators available). Developers will still need to install Visual Studio and the Windows Mobile 6 SDK prior to running the tool kit installer.

The Windows Mobile 6.5 Developer Tool Kit adds documentation, sample code, header and library files, emulator images and tools to Visual Studio that let you build applications for Windows Mobile 6.5. This document contains important information about this package. The Windows Mobile 6 SDK must also be installed in order to use any of the Windows Mobile 6.5 Gesture API or samples. Windows Mobile 6.5 Developer Tool Kit comes with the following Emulator Images:

  • Windows Mobile 6.5 Professional Square Emulator
  • Windows Mobile 6.5 Professional QVGA Emulator
  • Windows Mobile 6.5 Professional WQVGA Emulator
  • Windows Mobile 6.5 Professional VGA Emulator
  • Windows Mobile 6.5 Professional WVGA Emulator
  • Windows Mobile 6.5 Standard Square Emulator
  • Windows Mobile 6.5 Standard QVGA Emulator

Available locales:
0804 CHS Chinese Simplified
0409 USA English
0407 GER German
040c FRA French
0410 ITA Italian
0c0a ESN Spanish

A new set of APIs is being introduced that will enable application developers to take advantage of the new Windows Mobile 6.5 touch gesture framework. The gesture APIs allow an application to handle touch gesture input and provide a visually consistent experience with the rest of the device UI. Note that the gesture APIs are only available on the Windows Mobile Classic and Professional SKUs. The headers and libraries are installed in the Windows Mobile SDK\Pocket PC\ folder. Samples that make use of these APIs are installed into the Windows Mobile 6.5 Developer Tool Kit\Samples\ folder.

Happy programming!!

General : Uncovering Memory bottlenecks

Memory is often the source of performance problems, and you should always rule out memory problems before examining other areas of the system. Here’s an overview of counters that you’ll want to track to uncover memory, caching, and virtual memory (paging) bottlenecks.

I read this wonderful article. You can read the full article online now.

AD article: Managing multiple Active Directory schemas

Each Active Directory forest has its own schema, which defines the objects and attributes that the directory service uses to store data.

When organizations have multiple Active Directory forests, IT administrators have to manage multiple Active Directory schemas; ensuring consistency between schemas is vital when managing multiple forests.

In the April issue of TechNet Magazine, John Policelli guides you through a streamlined process to manage multiple Active Directory schemas.

Read the full article online now.

.Net Troubleshooting : How to uninstall the components of the .NET Framework 3.5 SP1?

Do you want to un-install the components of the .Net Framework 3.5 SP1?

Then you need to read this article (article by Aaron),  in which he described his experience, how to uninstall the components of the .Net Framework 3.5 SP1?

He gave the clear step-by-step information how we can uninstall the components of the .Net framework 3.5 SP1 in Windows XP, Windows Server 2003, Windows Vista and Windows Server 2008.

Related article:

Download Microsoft Framework 3.5
http://www.microsoft.com/downloads/details.aspx?FamilyId=333325FD-AE52-4E35-B531-508D977D32A6&displaylang=en

Troubleshooting : EWS request throws “The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel” ?

One of my customer updated that whenever they try to make the remote Exchange Web Service (EWS) call from his C#.Net 2008 application (VS.Net 2008 - .Net Framework 3.x), he gets the following error:

The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel

I had a detailed look at their application code.

// Create the Exchange Service Binding        
ExchangeServiceBinding esb = new ExchangeServiceBinding();        
 
// Add its relevant Credentials like user name, password, domain and URL        
esb.Credentials = new NetworkCredential(userName, Password, domain);        
esb.Url = @"https://myexchangeserver/EWS/Exchange.asmx";

We checked the credentials passed; it seems everything was fine. But still it was failing whenever we make the request to the server with the above same message. When we checked their environment, we found customer uses the self-signed certificate on the server. This is because, by default, .NET checks whether SSL certificates are signed by a certificate from the Trusted Root Certificate store.

To over-ride this behavior, we need to use the following line in the code, which validate the x509 certificate:

ServicePointManager.ServerCertificateValidationCallback = (sender, certificate, chain, sslPolicyErrors) => true;

This will accept all certificates, regardless of why they are invalid, which resolved the customer’s issue.

By validating the X509 certificate provided by the computer running Microsoft Exchange Server 2007 for SSL over HTTP, you help to provide a layer of security for the client application. You must validate certificates before you can start programming with Exchange Web Services proxy classes. If the callback is not set up, the first call will fail with a certificate error.

Happy troubleshooting!!

Part # 2 - Using C#.Net & Exchange Web Service (EWS) : How to create and send e-mail messages?

In this we will see how to create & send e-mail messages using Exchange Web Service (EWS). It’s pretty simple with EWS to do.

       // Create the Exchange Service Binding
        ExchangeServiceBinding esb = new ExchangeServiceBinding();
 
       // Add its relevant Credentials like user name, password, domain and URL
        esb.Credentials = new NetworkCredential(userName, Password, domain);
        esb.Url = @"https://myexchangeserver/EWS/Exchange.asmx";
 
        // CreateItemType and set its relevant properties/values
        CreateItemType request = new CreateItemType();
       
        // Select Message Disposition specified
        request.MessageDisposition = MessageDispositionType.SendOnly;
        request.MessageDispositionSpecified = true;
      
       // Create MessageType and set its relevant properties/values
        MessageType message = new MessageType();
 
        // Enter value for subject
        message.Subject = subject;
        message.Body = new BodyType();
        message.Body.BodyType1 = BodyTypeType.Text;
 
       // Enter value for body
        message.Body.Value = body;
        message.ToRecipients = new EmailAddressType[1];
        message.ToRecipients[0] = new EmailAddressType();
       
       // Enter ToEmailAddress
        message.ToRecipients[0].EmailAddress = toEmailAddress;
 
       // Select Routing Type
        message.ToRecipients[0].RoutingType = "SMTP";
        request.Items = new NonEmptyArrayOfAllItemsType();
        request.Items.Items = new ItemType[1];
        request.Items.Items[0] = message;
        try
        {
           CreateItemResponseType response = esb.CreateItem(request);
 
           // Determine whether the request was a success.
            if (response.ResponseMessages.Items[0].ResponseClass == ResponseClassType.Error)
            {
                throw new Exception(response.ResponseMessages.Items[0].MessageText);
            }
            else
            {
                Console.WriteLine("Item was created");
                Console.Read(); 
            }
          }
 
          catch(Exception e)
            {
                Console.WriteLine(e.Message);
                Console.Read();
            }

Try this code snippet. Happy programming!!

Code snippet using OOM : How to modify in-appropriate CSS/HTML tags available in the Outlook e-mail’s HTMLBody ?

Hi,

Please find the following code snippet shows how we can modify/edit/add more or in-appropriate CSS/HTML tags available in the Outlook e-mail’s HTMLBody using Outlook Object Model:

'[Code Snippet - Outlook Object Model 
'[How to modify Outlook e-mail's inappropriate CSS/HTML tags from its HTML Body
...
'Definition
Dim str As String
Dim str1 As String
Dim omailitem As Outlook.MailItem
Dim oattach As Outlook.Attachment
Dim ofolder As Outlook.Folder
 
'str1 stands for CSS/HTML tag that needs to be removed from mail's HTMLBody
str1 = "<myNameisRemote_style_0 <!--.Quote{margin-left:1pt;padding-left:4pt;border-left:#6000002pxsolid;}--=""""" & "></style>"
'Pick the Folder
Set ofolder = Application.Session.PickFolder
'Loop through the items
For Each Item In ofolder.Items
'Select a single item
Set omailitem = Item
str = Trim(omailitem.HTMLBody)
'Check the HTMLBody has "myNameisRemote_style_0" string in this mail using Instr()
If InStr(str, "myNameisRemote_style_0") Then
'If Yes, then replace it
str = Replace(str, str1, " ")
Debug.Print "this has " & str
' Assign the replaced value back to HTMLBody
omailitem.HTMLBody = str
'Save the mail message
omailitem.Save
Else
Debug.Print "Not Problem with <myNameisRemote_style_0 CSS_HTML tags"
End If
Next
....
More Posts Next page »
Page view tracker