ContactEmail Class

Current information about Live Connect is now available in the Windows Live Developer Center. The information in the following sections is provided for legacy purposes only.

An instance of DataItem that provides programmatic access to email information for a Windows Live contact.

Feature:  Microsoft.Live.Services
Namespace:  Microsoft.Live.Services

The JavaScript Library for Windows Live Messenger Connect is built by using the Microsoft Ajax Library. Microsoft Ajax exposes a type system that enables you to add object-oriented capabilities to your JavaScript code. To learn more about creating, instantiating, and deriving from classes, see Creating Custom Client Script by Using the Microsoft Ajax Library.

Microsoft.Live.Services.ContactEmail = function();


To request contacts for an authenticated user from Windows Live, you work with a ContactCollection instance. The ContactCollection instance is a collection of Contact objects. Each contact instance exposes properties that define the contact. The emails property of the Contact class allows programmatic access to email information for the contact.

The code example in this section demonstrates how to create a new instance of ContactEmail, and how to set and get its properties. Note that the isIMEnabled property returns undefined (JavaScript) because it was not defined. Also, note that the emails property can take an array of ContactEmail instances.

        var sb;
        var br = "<br/>";
        var out = document.getElementById("Output");
        var contact1 = new Microsoft.Live.Services.Contact("test");
        var contactEmail1 = new Microsoft.Live.Services.ContactEmail("");
        sb = "Email Address = " + contact1.get_emails()[0].get_address() + br;
        sb += "Email Type = " + Microsoft.Live.Services.ContactEmailType.toString(contact1.get_emails()[0].get_type()) + br;
        sb += "Email IsIMEnabled = " + contact1.get_emails()[0].get_isIMEnabled() + br;
        out.innerHTML = sb;


Windows Live Messenger Connect

Supported in: 4.1

Internet Explorer 8.0, Internet Explorer 7.0, Internet Explorer 6.0, Firefox 3.6, Firefox 3.5, Firefox 3.0, Firefox 2.0, Firefox 1.5, Chrome 4.0, Chrome 3.0, Chrome 2.0, Chrome 1.0, Safari 4.0, Safari 3.0