[英]Email verification in android app
I am developing an email verification ie user enter his/her email, app send a message to user email with some random code. 我正在开发电子邮件验证,即用户输入他/她的电子邮件,应用程序使用一些随机代码将消息发送到用户电子邮件。 This is kind of OTP system where user has to provide this OTP to verify screen. 这是一种OTP系统,用户必须提供此OTP来验证屏幕。
My problem is I am not receiving email. 我的问题是我没有收到电子邮件。 I am using below code in the register.java 我在register.java中使用以下代码
private void sendEmail(String mail,String val)
{
Log.d("mail:",mail);
Log.d("val",val);
Intent i = new Intent(Intent.ACTION_SEND);
i.setType("message/rfc822");
i.putExtra(Intent.EXTRA_EMAIL , new String[]{mail});
i.putExtra(Intent.EXTRA_SUBJECT, "Welcome user");
i.putExtra(Intent.EXTRA_TEXT , "Please enter the code "+val+" to verify your account");
try {
startActivity(Intent.createChooser(i, "Send mail..."));
} catch (android.content.ActivityNotFoundException ex) {
Toast.makeText(Register.this, "There are no email clients installed.", Toast.LENGTH_SHORT).show();
}
}
I checked the mail and val value in Log.d is showing valid values, but I am not receiving email on my gmail.(i am using my own id for testing). 我检查了Log.d中的mail和val值是否显示有效值,但我没有在gmail上收到电子邮件(我使用自己的ID进行测试)。 Thanks Deepak 谢谢Deepak
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.