Facebook connect api cannot get email
<p>I've set scope on the login button, it asks permission for email but can't get email info. i'm testing it so fyi i have a main email and it's approved.</p>

<p>I did this, but it didn't solve my problem:
<a href="https://stackoverflow.com/questions/17532476/facebook-email-field-return-null-even-if-the-email-permission-is-set-and-acce/20594547#20594547">Facebook Email field return null (even if the “email” permission is set and accepted)</a></p>

<p>This is my code:</p>

<pre><code>define('YOUR_APP_ID', 'x');
define('YOUR_APP_SECRET', 'x');

include_once 'facebook/facebook.php';

$facebook = new Facebook(array(
 'appId' =&gt; YOUR_APP_ID,
 'secret' =&gt; YOUR_APP_SECRET,
));

$userId = $facebook-&gt;getUser();

&lt;script&gt;
window.fbAsyncInit = function() {
 FB.init({
 appId : &lt;?=YOUR_APP_ID?&gt;,
 status : true,
 cookie : true,
 xfbml : true,
 oauth : true,
 });

 FB.Event.subscribe('auth.login', function(response) {
        loading(1);

        &lt;?
        if ($userId) {
        $userInfo = $facebook-&gt;api('/' + $userId + '?locale=en_US&amp;fields=id,name,email');  
        }
        ?&gt;
        var mail = "&lt;?=$userInfo['email']?&gt;";

        $.post("&lt;?=$sozlukscripti["path"]?&gt;inc/reglogin.php", { islem: "fbgiris", mail: mail }, function(data) {
            if(data) {
                location.reload();
            }
            else {
                $.pnotify({title: 'giriş başarısız', text: '&lt;? _e("k. adı &amp; mail ya da şifre yanlış"); ?&gt;', type: 'error'});
            }
        loading();
        }); 
        return false;
 });

 };

(function(d){
 var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
 js = d.createElement('script'); js.id = id; js.async = true;
 js.src = "//connect.facebook.net/en_US/all.js";
 d.getElementsByTagName('head')[0].appendChild(js);
 }(document));
&lt;/script&gt;
</code></pre>

<p><code>reglogin.php</code> sets sessions for my members. If I set var mail to my email (<code>user@example.com</code>), code works. I can't get email for facebook connect.</p>

<p><strong>my button code</strong>:</p>

<pre><code>&lt;div id="fb-root"&gt;&lt;/div&gt;
&lt;fb:login-button scope="email"&gt;&lt;/fb:login-button&gt;
</code></pre>

<p>thank you in advence.</p>