Q:

How to send Verification/Confirmation Email when user have registered in Android? 

I've made an UI in xml file and i have Email_Navigator. Java file which can
validate all the fields for Registration but while clicking on Button called 
Submit than mail should be gone to the entered Email.  how can i do this?  

A:

Create classes 

Session.java
private Session createSessionObject() {
     Properties properties = new Properties();
     properties.put("mail.smtp.auth", "true");
     properties.put("mail.smtp.starttls.enable", "true");
     properties.put("mail.smtp.host", "smtp.gmail.com");
     properties.put("mail.smtp.port", "587");

    return Session.getInstance(properties, new javax.mail. Authenticator() {
    protected PasswordAuthentication getPasswordAuthentication() {
        return new PasswordAuthentication(username, password);
    }
    });
}

Message.java
private Message createMessage(String email, String subject, String messageBody, Session session) throws MessagingException, UnsupportedEncodingException {
    Message message = new MimeMessage(session);
    message.setFrom(new InternetAddress("tutorials@tiemenschut.com", "Tiemen Schut"));
    message.addRecipient(Message. RecipientType. TO, new InternetAddress(email, email));
    message.setSubject(subject);
    message.setText(messageBody);
    return message;
}

Define an inner class in the Activity sending the mail like this:
private class SendMailTask extends AsyncTask<Message, Void, Void> {
private ProgressDialog progressDialog;

@Override
protected void onPreExecute() {
    super.onPreExecute();
    progressDialog = ProgressDialog.show(MainActivity.this, "Please wait", "Sending mail", true, false);
}

@Override
protected void onPostExecute(Void aVoid) {
    super.onPostExecute(aVoid);
    progressDialog.dismiss();
}

@Override
protected Void doInBackground(Message... messages) {
    try {
        Transport.send(messages[0]);
    } catch (MessagingException e) {
        e.printStackTrace();
    }
    return null;
}
}

Then at last call this method in your onClick:
private void sendMail(String email, String subject, String messageBody) {
    Session session = createSessionObject();

    try {
        Message message = createMessage(email, subject, messageBody, session);
        new SendMailTask().execute(message);
    } catch (AddressException e) {
        e.printStackTrace();
    } catch (MessagingException e) {
        e.printStackTrace();
    } catch (UnsupportedEncodingException e) {
        e.printStackTrace();
    }
}

NOTE: username & password in passswordAuthentication() are your mail credentials which you will be using for sending mails. 
For better explaination
Check out this link :
http://www.tiemenschut.com/how-to-send-e-mail-directly-from-android-application/

