How to retrieve email addresses from my gmail account? - facebook-graph-api

I am writing an "Invite Users" feature for my website.
I wanted the user to enter his gmail credentials or facebook credentials, and I wanted to send emails to the friends he chooses from.
Although I found out that you cannot send privates messages to your friends on FB via the API.
How can I accomplish the same using google / gmail ?

You should use the Google Contacts API along with OAuth. Accepting the user's GMail ID and password on your own site is never a good idea. http://code.google.com/apis/contacts/

Related

How can I allow users to send emails through my django app but coming from their own gmail account?

I have a django app where users can send emails through the app to contacts that they upload themselves. I use Sendgrid to send the email and the recipient receives an email from a "white-label" address like hello#mydomain.com
Now, I would like to implement a system where I can allow users to send emails through our app but that those emails are sent by their own email address. To make it simple, let's just consider "Gmail" and if a user want they can "login with their gmail account" on my app and then send emails from my app that are sent from their account... I know that Gmail has an API and I wonder if I can leverage it to do what I need.
You can definitely send emails using Gmail API methods but keep in mind the below stated in their official documentation:
Note: The Gmail API shouldn't be used to replace IMAP for developing a
full-fledged email client. Instead, see IMAP, POP, and SMTP.
As they recommend, you could integrate IMAP/SMTP features in your application so users can authenticate/provide access to their accounts and achieve your goal of having emails sent from their accounts.

Is it possible to send and fetch Facebook messages using Graph API for v4.0 or greater?

I want to create a web application using PHP which will allow to connect Facebook accounts with my application and once they authenticated my application can fetch inbox messages of that user and can auto reply to the messages received against authenticated Facebook accounts.
Also, allow user to send messages manually from my application to Facebook inbox.
Is this possible with Graph API or any other Facebook API which will allow me to do above mentioned things.
Some people was told that this feature is no longer available after Facebook Graph API v2.4.
and once they authenticated my application can fetch inbox messages of that user and can auto reply to the messages received against authenticated Facebook accounts.
Neither of those two things is possible.
You can not read the messages of user accounts any more, and you can not reply in their name either.
The only messaging that can be handled via API, is that between a user and a page.
Assuming you refer to Page conversations, not user conversation, see /conversations and /messages docs here:
https://developers.facebook.com/docs/graph-api/reference/page/conversations/
https://developers.facebook.com/docs/graph-api/reference/v5.0/conversation/messages

Emails landing with red banner in gmail inbox

Suddenly all the emails sent through gmail api are landing with a red banner in recipients inbox as shown below.
So, I created a new OAuth ClientID in Google Cloud platform and used those credentials to provide access to my test gmail account. Then I sent emails using Gmail Api and emails are landing in inbox without any red banner which is good.
But we need to use the same old OAuth ClientID as we have so many users who provided access to it. If we change these ClientID and ClientSecret to use the new one, we need all our users to re-authorize, which we don't want to do. Can someone help why the existing OAuth Client ID is throwing this red banner in recipients mailbox?
As stated in this blog, this warning message speaks about one of the security measures taken by Google. Also from this related SO post, either your message contains a scam web page that steal users informations or the Domain/IP of your server has been used in the past for stealing personal informations. Check if IP is blacklisted on Mxtoolbox Configure Reverse DNS (Match your domain name with your IP), SPF and DKIM, Send legitimate email and everything will be fine.

How can I access email id's of my facebook friends

I am using koala(ruby gem/Facebook Api).
I want to access email list of my Facebook friend's.
Contacts (mac app) can access my friend's email id and their mobile phone no's.
How can I do that???
I don't particularly program with the facebook api. I wouldn't think they would provide you with direct access to information not published. Most sights such as Google (gmail) and Yahoo provide email addresses for their users that is associated with their username.
Facebook does also. Just use their public.username#facebook.com, just as you would a person's username#yahoo.com or their username#gmail.com.
Try
fb_api = Koala::Facebook::API.new(access_token)
fb_api.api("me/friends?fields=email")
but not every user will have entered the email address

Get Facebook friends using email and password

I need to get the facebook friends email ids of a user providing his login email id and password. That is, if we enter the facebook login email id and password we need to get the friends from facebook. So far i was only able to get the examples which uses Api_Key and Api_Secret. Even the Graph api is using Access Token. Is there any way to access the friends using email id and password? Please help.
This is against Facebook's Terms of Service. Specifically policy I.2:
You must not include functionality that proxies, requests or collects
Facebook usernames or passwords.
Also, you would be required to use the Facebook API which does not provide access to friends email addresses.
You'll need to ask your users to authenticate using the Facebook API. You shouldn't be collecting email and passwords on behalf of users. However, if you ask for offline access, then when you do this, you can access the data any time.
Facebook uses oAuth, so you and your application will never see the password of the user that you are getting permission for. oAuth (used by Twitter and Google as well) requires a bit of a handshake to get authenticated, but once you do, you can get permission from the user to do whatever you want, as long as they accept.
Check out https://developers.facebook.com/docs/guides/web/#login for more on how Facebook does authentication.