Home > Back-end >  How to send response which got from server to the email?
How to send response which got from server to the email?

Time:11-18

I got my forgotted password from API. I want to send that password to the email address. I tried many option but still i was unable to send that password.

CodePudding user response:

Best way to do this is from your backend using smtp headers its more secure and efficient because its a sensitive data... Never let your client side know about this kind of data type. You can do this using bash by following this tutorial

CodePudding user response:

We can send emails with this tutorial

BackgroundMail.newBuilder(this)
                .withUsername(from - emailid)
                .withPassword(from - emailid password)
                .withMailto(to - emailid)
                .withType(BackgroundMail.TYPE_PLAIN)
                .withSubject("Subject")
                .withSendingMessageSuccess("email sent successfully")
                .withBody("Body")
                .withOnSuccessCallback(new BackgroundMail.OnSuccessCallback() {
                    @Override
                    public void onSuccess() {
                        finish();
                    }
                })
                .withOnFailCallback(new BackgroundMail.OnFailCallback() {
                    @Override
                    public void onFail() {
                    }
                })
                .send();
  • Related