ContactEmail Class

Ff748760.note(en-us,MSDN.10).gifNote:
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.

Script:  http://js.live.net/4.1/loader.js
Feature:  Microsoft.Live.Services
Namespace:  Microsoft.Live.Services
 
Ff748760.alert_note(en-us,MSDN.10).gifNote

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();

Type.registerClass(
    'Microsoft.Live.Services.ContactEmail',
    Microsoft.Live.Services.DataItem);

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("test@contoso.com");
        contactEmail1.set_type(Microsoft.Live.Services.ContactEmailType.personal);
        contact1.set_emails([contactEmail1]);
        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;

Object
  Microsoft.Live.Services..::.DataItem
    Microsoft.Live.Services..::.ContactEmail

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

Show: