Send application direct email

1

can you send an email with a direct suggestion of the Application, without opening an external application, type Gmail? Example:

A field where the person places the email and another field it per suggestion and a submit button. After all the pop-up when it hits the send button, does the email fire without opening the default email application that is set up on the smartphone?

I did a test with the code below, it works however it opens the external application.

 FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
    fab.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            Snackbar.make(view, "Envie sua sugestão para o nosso email", Snackbar.LENGTH_LONG)
                    .setAction("Enviar", new View.OnClickListener() {
                        @Override
                        public void onClick(View v) {
                            Intent email = new Intent(Intent.ACTION_SEND);
                            email.setData(Uri.parse("mailto"));
                            email.setType("message/rfc822");
                            email.putExtra(Intent.EXTRA_EMAIL,
                                    new String[]{"aquieucolocomeuemaildecontato"});
                            email.putExtra(Intent.EXTRA_SUBJECT,
                                    "Sugestão: ");
                            email.putExtra(Intent.EXTRA_TEXT, "Olá " + "");
                            startActivity(Intent.createChooser(email, "ENVIAR E-MAIL"));
                        }
                    }).show();
        }
    });

}
    
asked by anonymous 03.07.2017 / 22:09

1 answer

0

Yes, this is possible! But you need to develop a API < to do it for you. This api will run on a server / cloud (which will require the cellphone to have an internet connection) that will receive the call from your application containing the information that will be sent by email and will send it to you.

With a quick search you can figure out how to do this using the language of your choice, I'll list two links that can help you implement this very easily:

If you'd like to make your life even easier, use Sendgrid or Mailgun to assist you with these submissions

    
03.07.2017 / 22:20