2

I have created and Simple app to send e-mail using Intent, with dynamic fields(get required fields at runtime). It works fine.

But i need to add CC to the sender email id. The email has to be sent for the sender email id when it is also sent to the recipient mail-id.

I know the procedure to add the CC through intent by this code.

emailIntent.putExtra(Intent.EXTRA_CC, "sender's mail id");

I need the sender's email id to put there. I've tried this for lot of time. But, not yet result get it. Anyone guide me. Thanks in Advance.

Update -

From this Question. I can successfully add the Gmail's Primary email id. But, if i choose the Email instead of Gmail, i can't get primary email id. I've use this code to fetch the email id -

    AccountManager manager = AccountManager.get(TestActivity.this);
    Account[] accounts = manager.getAccounts();
    int size = accounts.length;
    String[] names = new String[size];
    for (int i = 0; i < size; i++) 
    {
        names[i] = accounts[i].name;
    }

If i use this code means, i can get the all Synchronized email accounts which are all synchronized in Gmail but not in Email. Why this happend? Anyone Guide me?

Community
  • 1
  • 1
Praveenkumar
  • 24,084
  • 23
  • 95
  • 173

1 Answers1

0

For that you need to get user's EmailID

You can get user's ID and as well Device's Primary ID

Use this answer here to get that.

And add them to your Intent.

I understand what you want,but I doubt It's not possible cause Once you fired any intent,then User will select Email or Gmail , But you have set CC long before so you can't update it's value depend on user selection simple.

Community
  • 1
  • 1
MKJParekh
  • 34,073
  • 11
  • 87
  • 98