Reputation: 53850
Let's assume I have users registered in my GAE application with their Google accounts that they use to access GMail, Calendar, Contacts etc. They confirm that my app can send email messages from their GMail account and when they click some link, like "Send a notification to all my friends", the message goes where it's supposed to go from the users' GMail accounts. Is that possible to do without asking users to share their login and password with my application?
Upvotes: 1
Views: 182
Reputation: 2435
From the GAE Mail API docs:
The email address of the sender, the From address. The sender address must be one of the following types:
- The address of a registered administrator for the application. You can add administrators to an application using the Administration Console.
- The address of the user for the current request signed in with a Google Account. You can determine the current user's email address with the Users API.
- Any valid email receiving address for the app (such as [email protected]).
So, if they are logging into your app using the Users API, you can just set the sender
to the email address associated with the user's account:
message.sender = users.get_current_user().email()
Upvotes: 2