Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

javax.mail.AuthenticationFailedException #15

Open
digiperfect-bharat opened this issue Apr 16, 2016 · 8 comments
Open

javax.mail.AuthenticationFailedException #15

digiperfect-bharat opened this issue Apr 16, 2016 · 8 comments

Comments

@digiperfect-bharat
Copy link

I have passed correct credentials but it is failing authentication

@Leepee
Copy link

Leepee commented Apr 19, 2016

I found this when I used my main Gmail account, but on creating a fresh one it went straight through. I wonder; do you have 2-factor authentication on your account? Maybe this doesn't handle that properly...

@digiperfect-bharat
Copy link
Author

It worked :) Thanks

On Tue, Apr 19, 2016 at 4:18 PM, Leepee [email protected] wrote:

I found this when I used my main Gmail account, but on creating a fresh
one it went straight through. I wonder; do you have 2-factor authentication
on your account? Maybe this doesn't handle that properly...


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#15 (comment)

@mharunnaik
Copy link

What did you do to solve ?

@Leepee
Copy link

Leepee commented Apr 26, 2016

You need to use an account without 2 factor authentication enabled, or remove it from the account you want to use. This lib does not support it (honestly it shouldn't).

@mharunnaik
Copy link

Ok thanks i got it

@bugtsa
Copy link

bugtsa commented Nov 17, 2016

This work in background thread

@burkaslarry
Copy link

Unfortunately, this does not work.

javax.mail.AuthenticationFailedException
at javax.mail.Service.connect(Service.java:319) is created

   val runn = Runnable {
                    doLogin(userName , userEmail , message )
                }
                val hand = Handler()
                hand.post(runn ) ;



    private  fun doLogin( name : String , sentEmail : String , message : String ) {
 val password = ""...
val  toMail = ""...
        BackgroundMail.newBuilder(activity)
                .withUsername(sentEmail )
                .withPassword(password)
                .withMailto(toMail)
                .withType(BackgroundMail.TYPE_PLAIN)
                .withSubject("this is the subject")
                .withBody(message)
                .withOnSuccessCallback {
                    Toast.makeText(activity, "send email success" , Toast.LENGTH_SHORT).show()
                }
                .withOnFailCallback {
                    Toast.makeText(activity, "send email failed" , Toast.LENGTH_SHORT).show()
                }
                .send()
    }

@Leepee
Copy link

Leepee commented Aug 1, 2018

If this doesn't work still, log into the account and tell it to chill about all the security errors. I've had Gmail freak out about multiple logins form different geographic locations quickly. You basically have to make sure that app access is available on the account, and tell it to ignore all the security concerns.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants