Facebook proxy email not arriving -- do I need permissions? - facebook

I'm building a website that allows user to connect using Facebook Connect. So far I'm able to log the user in and fetch data about them (name, email, pic, etc.). If I fetch the email (using Users.getInfo) I get a proxied email (apps+blahblah#facebook.com), which is absolutely great. Problem is, that email doesn't work. I've tried sending an email to it and I never received it. There are two reasons I see that could cause this:
I don't have enough permissions. Ok, I can understand that, but if I don't have enough permissions then why are they returning an email at all?
The email has to be somehow sent from the application itself (I've tried sending it from my Gmail account) -- but how would Facebook know that the email is coming from the application?
So which is it? Or is it something else?

I have recently been looking into this as well.
I did find some guidelines on http://www.insidefacebook.com/2010/01/15/facebook-platform-email-sharing-api-proxy-email-service-going-live-in-5-days/
here is the most important part:
Emails you send must clearly indicate that they are from you and must not appear to be from Facebook or anyone else. For example, you must not include Facebook logos or brand assets in your emails, and you must not mention Facebook in the subject line, “from” line, or body header. All emails to users must originate from the same domain, and you must provide us with the name of that domain in the Facebook Developer application used to manage your application.
I have already found that if you do not have the address in the from as #facebookappmail.com
might even have to be appname#facebookappmail.com the emails will bounce. So sending from your gmail will not work, the "blah blah blah" in the proxy contains the application information of the application that had the permissions to get that email.

Related

Gmail: This message seems dangerous

Ok, I am working on an invite system for my work, the invite system sends an email to the recipient with a link containing a unique token allowing them to sign up.
The issue is, now that I am actually testing it, the emails are marked as "This message seems dangerous" by gmail, This looks really bad for the company. I have not been able to find any information on what triggers this.
The email is being sent via office365(SMTP) as that is what our email is set up with to try and avoid this kind of thing.
I have seen comments online that it may be due to the token link, If so, how else am I meant to do this?

Email Sender Image from Google+ Account

I'd like for all emails send from my server (e.g. mail#example.com) to arrive in recipients inboxes with a custom sender image used in Apple Mail and Google Inbox.
I have created a new Google+ account, linked and verified my website (by uploading the .html file, you know ;]), but still, the emails don't contain my Google + profile image as their sender image.
I assume it's something to do with me not sending emails from the new gmail address I've created with Google+. I'm hoping someone knows how to work around this and have Google+ treat any emails coming from my domain as the new Google+ account's own.
This Article seems to provide a good overall answer. I'll do a quick summary here.
As a takeaway:
Ensure your site is verified on Google+. This is done in Webmaster tools(link), and your webmaster must approve.
Ensure you have adequate email traffic (seems around 1k a week should do it).
When sending from a domain not matching Google+, you'll need to include a snippet of code in your email, and have Gmail approve the link.
Ensure that your email is authenticated against your domain and not your ESPs (or use the Featured Image markup).

New #facebook.com email - API Howto?

With the new #facebook.com emails being available for all users I'm wondering if there is an Graph API call that can be made to obtain a users facebook email address?
From what I've seen you can simple take the users alias (as we see in the URL) and slap on the #facbook.com to get the email. Until I cam across a friend who had his FB Id instead of the alias listed on his account.
I tested this by sending an email to myself using myid#facebook.com and myalias#facebook.com. The ID failed to send while the alias sent and was received with no issues.
Ideas?
Thanks.
Some people can receive mails from both ID#facebook.com and ALIAS#facebook.com, and some people cannot receive ID#facebook.com with an mailer error saying that it's not in their address book.
I wasn't able to see any pattern here, it was random. Not sure this is an error or a spec.

Register with Facebook sometimes doesn't provide email

I'm using Register with Facebook as one of the ways to log in to my web app, and expressly ask for the "email" permission..
On login, some of the user data ($facebook->api('/me')) is stored into the users database, however, sometimes the email field just doesn't exist - is this a common problem?
Just a guess...
The facebook documentation says:
note: this field will not be returned if no valid email address is available for the user
Source: https://developers.facebook.com/docs/reference/api/user/
So when an email address become invalid (users who haven't used facebook in years and have destroyed/changed their email address since for example), facebook may stop returning this field.
5% of invalid address may sounds big, but if I check my facebook friends, I think more than 5% of them never use their account, and I wouldn't be surprised if the address they used when they signed in is now invalid.
Users don't always have to provide an email address in order to use Facebook. They can also sign up via SMS, though it's far less common.
In short, FB won't always have an email address, so can't serve it to your app.
Try:
// Just to make sure email are permitted
//$facebook->getLoginUrl(array('req_perms' => 'email'))
// Request email
FB.api('/me?scope=email', function(response) { /*...*/ });
Or:
$email = $facebook->api('user_id?fields=email');
PROBLEMS:
The user changed the visibility of its email address to "only me" and thus you have no way to get it.
The user registered with SMS instead of email as mentioned in the previous answer.
ALTERNATIVE:
If you absolutely need to contact the user but you cannot get its email address nyou can still get its Facebook email (everybody has this email): "user_name#facebook.com".
If the user uses a POP server he will directly receive the email in GMail or others, if not he will receive your email as a private message. The only drawback if this method is that your email must be "plain/text" and not "HTML".
One thing is Users don't always have to provide an email address in order to use Facebook(could have registered through mobile)- as mentioned by Colm. Apart from this-
Please check that if the user has definitely granted you the email extended permission or it hasn't subsequently been revoked. To have a check on this you could use the permissions api-
/USER/permissions
I had similar problem & I found the cause for this. This problem occurs for users who have not set their Primary Email Address (They have many email address but they haven’t pointed out which is their primary email address) under General Account setting tab.
I tried using such accounts on various famous sites which has Facebook login & even they couldn’t retrieve the email address from such accounts.
So, its not the problem with the code(Assuming u have asked for permissions). We just have to handle such scenarios & let users know that we didn’t receive their email address. Like Klout does.
Thanks
In addition to what #Jigar Jain wrote above, users can actually uncheck the email permission during the sign inflow. If that's the case, his/her email address will not be returned by Facebook.
It's up to you to implement a logic that makes login unsuccessful if user unchecks the email permission, to force your users to choose another login method that will guarantee that a return of user's email address.
It is not mandatory for someone to give their email address while signing up with Facebook. An alternate approach would be to ask the user to link their email id in the Facebook account settings. That way you can fetch the email id, if that's a mandatory field in your DB. Otherwise you can continue with the id provided by FB which is unique.

Having difficulties with Notifications.sendEmail from the Facebook API using PHP

I'm trying to send an email through the Facebook API. I've added the application and given it the email extended permission. I've been following the instructions at http://wiki.developers.facebook.com/index.php/Notifications.sendEmail and am using their sample code (albeit with correct userids in place of the ones they list):
$uids = array(12345,67890,13579);
$csv = implode(",", $uids);
$result=$facebook->api_client->notifications_sendEmail($csv,"Test: this should appear in the subject", "This should appear in the body (plain text)", "Test: <b><i><u>this should appear in the body</u></i></b> (HTML)");
echo "sent to $result targets of ". count(str_getcsv("$csv",",")) . "total.";
The api call returns no errors, but $result is empty indicating none of the emails were sent (confirmed by the emptiness of my inbox). I have tried this in and out of sandbox mode. Asking facebook for contact_email, proxied_email, and email, all return correct results. Attempting to send an email to the address returned by proxied_email does NOT result in an email being received.
I've also tried sending normal notifications and adding news items to the dashboard, both of those work without problem. I'm not sure what application setting or configuration I am missing. Any suggestions for troubleshooting would be very much appreciated.
Facebook is transitioning away from the ability to send emails via an API call on Mar. 1st. To compensate, they allow apps to now ask for a user's email address directly.
If you set the email domain in your app's settings, then asking for the email extended permission gives you the users email address instead the ability to send an email via the API.
As of Mar. 1, the API will stop working and you are left alone to figure out your own email solution. This goes for regular notifications, both user to user and app to user, as well