0

Is there a way on how to send email verification in Gmail inbox and not in spam? I'm developing a mobile application using android studio, the language I am using is java. The email verification mail keeps on sending in the spam folder. Here is my code.

 mAuthLo.createUserWithEmailAndPassword(loEmail, loPassword).addOnCompleteListener(new OnCompleteListener<AuthResult>() {
            @Override
            public void onComplete(@NonNull Task<AuthResult> task) {

                if (task.isSuccessful()) {
                    LoUserHelperClass loHelperClass = new LoUserHelperClass(loName, loEmail, loPhoneNo, loPassword);

                    FirebaseDatabase.getInstance().getReference("loAccount").child(FirebaseAuth.getInstance().getCurrentUser().getUid()).setValue(loHelperClass).addOnCompleteListener(new OnCompleteListener<Void>() {
                        @Override
                        public void onComplete(@NonNull Task<Void> task) {
                            if (task.isSuccessful()) {
                                Toast.makeText(LandownerSignUp.this, "Account Created Successfully", Toast.LENGTH_LONG).show();
                                //otp
                                Intent intent = new Intent(getApplicationContext(),LoVerifyPhone.class);
                                intent.putExtra("loPhoneNo",loPhoneNo);
                                startActivity(intent);
                               // Intent intent = new Intent(LandownerSignUp.this, LoVerifyPhone.class);
                                //startActivity(intent);
                            } else {
                                Toast.makeText(LandownerSignUp.this, "Account Failed to Create", Toast.LENGTH_LONG).show();
                            }
                        }
                    });
                } else {
                    Toast.makeText(LandownerSignUp.this, "Account failed to create", Toast.LENGTH_LONG).show();
                }
            }
        });
    }
}
Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
SeniorBear
  • 11
  • 1
  • 4
  • Your code looks fine and has no influence on whether the verification email is marked as spam or not. See https://stackoverflow.com/questions/72922475/why-did-this-code-fail-to-send-password-reset-link-in-firebase for some workarounds. – Frank van Puffelen Sep 13 '22 at 13:12

0 Answers0