S
S
SocialFly2016-06-27 16:36:27
Android
SocialFly, 2016-06-27 16:36:27

Sending Email via Android. intent?

Hello. There was a need to send personal data. Naturally, I did it through Intent. Code below:

phone = phoneText.getText().toString(); //TextView с номером телефона
                        name = nameText.getText().toString(); //TextView с именем и фамилией
                        to = "my-mail.ru";

                        Intent email = new Intent(Intent.ACTION_SEND);
                        email.putExtra(Intent.EXTRA_EMAIL, new String[]{ to});
                        email.putExtra(Intent.EXTRA_SUBJECT, subject);
                        email.putExtra(Intent.EXTRA_TEXT, phone);
                        email.putExtra(Intent.EXTRA_TEXT, name);
                        
                        email.setType("message/rfc822");

                        startActivity(Intent.createChooser(email, "Выберите email клиент :"));
                        break;

So here's the problem, actually. When opening the same gmail on android, the Subject and to string are passed and written, but the rest are not.
Thanks in advance for the replies.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question