T
T
Tange2015-07-25 16:47:09
Java
Tange, 2015-07-25 16:47:09

How to find out the user's mail through the VK API?

ruseller.com/lessons.php?rub=37&id=1659 , created an application using this tutorial, but only this is displayed on the main page:

echo "Социальный ID пользователя: " . $userInfo['uid'] . '<br />';
        echo "Имя пользователя: " . $userInfo['first_name'] . '<br />';
        echo "Ссылка на профиль пользователя: " . $userInfo['screen_name'] . '<br />';
        echo "Пол пользователя: " . $userInfo['sex'] . '<br />';
        echo "День Рождения: " . $userInfo['bdate'] . '<br />';
        echo '<img src="' . $userInfo['photo_big'] . '" />'; echo "<br />";
    echo "День Рождения: " . $userInfo['mail'] . '<br />';

I need his email, does VK allow this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pavel Gromadchuk, 2015-07-25
@Gromadchuk

The user's email address is issued upon authorization. Authorization must be done with scope=email rights. After that, if the user does not deny access to his address, you will receive the user's email address along with the access_token, id, and token lifetime.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question