开发者

Android sending mail from a specific account

开发者 https://www.devze.com 2023-02-21 18:59 出处:网络
I have Exchange ActiveSync setup on my phone and it works as expected. My problem is that when I want to开发者_如何学编程 send an email in code it always uses the Gmail account (which of course I cann

I have Exchange ActiveSync setup on my phone and it works as expected. My problem is that when I want to开发者_如何学编程 send an email in code it always uses the Gmail account (which of course I cannot remove) as the sender. It is essential that the account used be the Exchange one as that is the users business email account.

I used the code from Send auto email programmatically

It works fine but uses the Gmail account. I have set the Exchange ActiveSync account as the default but it makes no difference. The application is used in a corporate environment only.


You can go ahead and clear defaults from Manage Apps screen in Settings. That should solve ur problem.


I had exactly the same issue in my project. There is a small bug in the referenced code.

The first line should read

emailIntent.setType("text/plain");

instead of

emailIntent.setType("plain/text");

This fixed it for me. Hope this helps.

0

精彩评论

暂无评论...
验证码 换一张
取 消