I saw a lot of posts about this, but i am still confused.
I am using Javax mail for sending email without intent.
Is there a way to send email from local user address without asking for user credentials?
I know how to get user name of local user, but is it mandatory to use the user password?
something like Gmail Auth? can it help?
The password is required by the gmail server, and for good reason. You would not want everyone being able to use your email account to send email without you being able to stop them.
The only way you will be able to accomplish what you want is to ask the user for their email password and store it so that you can use it later in automated sending. When the user changes their gmail password you will need prompt them to update their credentials.
Related
Currently, I am working on an Android project.
I started the project with sign up and login pages using Firebase. It goes like this:
A new user enters the required details with email and password as login credentials. Meanwhile, a verification mail is sent to the provided email address, the user needs to verify the authentication by following the link in the email. If he didn't authenticate the mail, he won't be able to log in.
Now here the problem occurs! What if the user accidentally deleted the email and now he is unable to login into the app, neither he could create a new account with the same email address as firebase won't allow that.
So, what should I do in this case? Please Help!
Firebase has no requirement that the user must have verified their email address before they can sign in. While you can definitely prevent the user from using your app and accessing its data until their email address has been verified, you can still call the API to sign them in.
So even when they've lost the verification email, you can call the signInWithEmailAndPassword API to sign the user in to Firebase, and then resend their verification email.
I have a small app with a working LoginActivity. I now want to develop a Fragment for this activity that will handle helping the user to create a new password if it has been forgotten. I have seen some people using PHP/MySQL for this, but I was wondering if it is possible to use Java/SQLite to accomplish the same goal?
Expected functionality:
User clicks forgot password link
Sent to ForgotPass_Fragment which asks/verifies a user's email.
If it is a valid email, email the user the code/new temp password
I guess the real question is if I can use Java to send an email to the user with the newly generated info rather than using PHP or some other language? Would something like this be the best practice?
Assuming your password recovery information is stored on a server, you will need to use some sort of server-side (PHP, or Java, or whatever) webservice to server the "recovery email".
If for some reason you already have the users password information on the phone (which would be a really bad idea) you could use a local Android Java call to respond with the information.
Bottom line, you will need a webservice to provide the password info the user.
Not a duplicate
I want to sent email without using any default email app so I searched a little bit and I stumbled upon this solution using JavaMail API -
Sending Email in Android using JavaMail API without using the default/built-in app
But I have few issues with this solution -
I don't want to use static username and password. Instead of that I want to use user's email ID. But it'll not be a good design if I directly ask user to enter his or her password.
So, how can I achieve this in a better way. Sorry, if this sounds too broad. Just looking for ideas not actual code.
Please, take a look at the Gmail API Android Quickstart guide. You'll be able to get the account credentials from Google Play Services and authenticate your user with OAuth2 by prompting an account selection
Instead of that I want to use user's email ID
As Gabe indicated, there is no "user's email ID" in Android. Beyond that, an "email ID" is insufficient for sending an email. You would have to ask the user both for all their email account information (username, password, SMTP server, etc.). Unless you are writing a full email client, hopefully nobody will give you this information.
how can I achieve this in a better way
Use ACTION_SEND or ACTION_SENDTO.
Or, send the email from your Web server, where your app tells the Web server what message to send via a Web service API that you implement and adequately secure. Then, you can use your own email account credentials without having to bake them into the app.
I try to develop parental control app and in setup page the parent enters his email to receive location of his kids.
when use JavaMail API using Gmail authentication, need password and email to send email to the parent (and it is not professional way to ask user email and password of his email).
And cannot be used intent because need without user interaction.
So Can anyone Help me or gives me and suggestions
I suggest send emails to user using Google account but without user interaction - If possible-
I have an android application - service, which sends data to the server and user is identified by email and password.
As I see I could save Google ID, name, email and etc once user is logged in, but if I use just Google ID to identify user in my service that could be unsafe. right? My service use POST method to send data to the server.
So, my question - is there any way to save Google account information and use it to identify that user on my server safely?