KnownContactField.Email | email property

Applies to Windows only

[KnownContactField may be altered or unavailable for releases after Windows 8.1. Instead, use ContactAddress, ContactPhone, ContactConnectedServiceAccount, or ContactEmail. ]

Contains the name of the field used for email addresses.

Syntax


var email = Windows.ApplicationModel.Contacts.KnownContactField.email;

Property value

Type: String [JavaScript] | System.String [.NET] | Platform::String [C++]

The name of the field.

Remarks

Use this property with the ContactPicker.DesiredFields property to specify that you want to get the email addresses of a contact.

Examples

This code demonstrates how to get an email address of a contact.


function selectKnownFields() {
    var picker = Windows.ApplicationModel.Contacts.ContactPicker();
    picker.commitButtonText = "Select";
    picker.selectionMode = Windows.ApplicationModel.Contacts.ContactSelectionMode.fields;
    picker.desiredFields.append(Windows.ApplicationModel.Contacts.KnownContactField.email);
    picker.pickSingleContactAsync().then(function (contact) {
        var contactElement = document.createElement("div");
        var contactData = contact.name + ", ";
        contactData += contact.emails[0].value + ", ";
        contactElement.innerText = contactData;
        document.body.appendChild(contactElement);
    });
}


Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

None supported

Namespace

Windows.ApplicationModel.Contacts
Windows::ApplicationModel::Contacts [C++]

Metadata

Windows.winmd

See also

KnownContactField

 

 

Show:
© 2014 Microsoft. All rights reserved.